This is a game that was written by me, and co-developed with iSean and Anthrax. It's a pretty simple game, written in the spirit of Halloween, which has already passed. I have a current game running in #Zombies on GamersVault - server -m irc.gamersvault.net -j #Zombies
NOTE
The file info for 'weapons.ini' is located here: http://www.hawkee.com/snippet/8012/
You must have this file in order to run the game properly. Just read and follow the directions in the description and you should be golden.
NOTE
BUG FIXES
8 Jan 2011
9 Jan 2011
10 Jan 2011
12 Jan 2011
on *:part:#:{ hfree $nick }
on $*:text:/^[`!@.](shop|kill|buy|stats|rank)/Si:#:{
;$iif($me != ZombieBot,halt)
set %m $iif($left($1,1) = @,.msg #,.notice $nick)
if !$ini(zombie.ini,$nick) { $NewPlayer }
if !$hget($nick) { hmake -s $nick 10 | hload -si $nick zombie.ini $nick }
if $regml(1) = kill { $iif($hget($nick,killtime),%m 14You must wait07 $duration($hget($nick,killtime)) 14before doing that04 $nick $+ 14.,$Kill) }
if $regml(1) = shop { Shop $2- }
if $regml(1) = buy { Buy $2- }
if $regml(1) = stats { $iif($iif($ini(zombie.ini,$2),$Stats($2),%m There is no one with that name.),$Stats($nick)) }
if $regml(1) = rank { Rank $2- }
pSave
flushini zombie.ini
BotCheck $nick
}
alias BotCheck {
hadd $nick idle $instok($hget($nick,idle),$hget($nick,idle.time),1,43)
var %idle = $hget($nick,idle), %i = $numtok(%idle,43)
if %i = 4 { if $calc( (%idle) / %i )) = $hget($nick,idle.time) { ban -ku3600 # $nick Timers Detected - 1 Hour Ban } }
hdel $nick idle.time
hinc -mc $nick idle.time
if $numtok($hget($nick,idle),43) = 4 { hdel $nick idle }
}
alias -l pSave { hsave -i $nick zombie.ini $nick }
alias -l NewPlayer {
if !$hget($nick) {
hmake $nick 10
hadd $nick weapon Chainsaw
hadd $nick level 1
hadd $nick xp 0
hadd $nick cash 0
}
}
alias -l Shop {
var %w = $ini(weapons.ini,0)
while %w {
var %Weapon = $+(14,[04,%w,14]04,$chr(32),$ini(weapons.ini,%w),14:07,$chr(32),$,$bytes($calc((%w - 1) ^ 3 * 1000),b),)
var %Weapons.List = $instok(%Weapons.List,%Weapon,1,47)
dec %w
}
%m $replace(%Weapons.List,$chr(47),14 / )
}
alias -l Buy {
if $1 !isnum { %m Please use the number associated with the weapon. | halt }
if $hget($nick,weapon) = $ini(weapons.ini,$1) { %m You already have that weapon, $nick $+ . | halt }
var %w = $ini(weapons.ini,$1), %price = $calc(($1 - 1) ^ 3 * 1000)
if $hget($nick,cash) < %price {
%m You cannot afford that yet, $nick $+ . | halt
}
else {
if $1 {
%m $nick buys a %w $+ !
hadd $nick weapon %w
hdec $nick cash %price
}
}
}
alias -l Kill {
var %score.kills = $score(kills), %score.cash = $score(cash)
var %zombies = $iif($r(1,$calc(3 * $ini(weapons.ini,$hget($nick,weapon)))) = 1,$v1 zombie,$v1 zombies)
var %weapon = $hget($nick,weapon), %cash = $floor($calc(($gettok(%zombies,1,32) * $r(2,5) * $hget($nick,level)) / 1.45))
var %xp = $floor($calc($gettok(%zombies,1,32) * 5 * ($hget($nick,level) / 2)))
hinc $nick kills $gettok(%zombies,1,32)
hinc $nick xp %xp
hinc $nick cash %cash
hadd -z $nick killtime $r(30,90)
$Level
%m $+(07,$nick,) $gettok($readini(weapons.ini,%weapon,kill),$r(1,$numtok($readini(weapons.ini,%weapon,kill),124)),124) :: $&
07[14Level:04 $hget($nick,level) $+ 07] - $&
07[10Zombies 14Killed:04 $bytes($hget($nick,kills),b) $+ 07] - $&
07[14Cash Gained:04 $+($,$bytes(%cash,b),07,]) - $&
07[14Experience Gained:04 $bytes(%xp,b) $+ 07] - $&
07[14Time:04 $duration($hget($nick,killtime)) $+ 07]
pSave
if $Score(kills) != %score.kills { $Score(kills).new) }
if $Score(cash) != %score.cash { $Score(cash).new }
}
alias -l Stats {
%m $&
07[10Zombies 14Killed:04 $bytes($readini(zombie.ini,$1,kills),b) $+ 07] - $&
07[14Level:04 $readini(zombie.ini,$1,level) $+ 07] - $&
07[14Experience:04 $bytes($readini(zombie.ini,$1,xp),b) $+ 07] - $&
07[14Cash:04 $ $+ $bytes($readini(zombie.ini,$1,cash),b) $+ 07] - $&
07[14Weapon:04 $readini(zombie.ini,$1,weapon) $+ 07]- $&
07[14Time:04 $iif($hget($1,killtime),$duration($v1),Ready) $+ 07]
}
alias -l Level {
var %l = $calc($hget($nick,level) + 1)
var %c = $calc(((%l * 13) ^ 2.23 * (%l / 4)) / 2)
if $hget($nick,xp) >= %c { hinc $nick level | %m $nick gains a level! }
}
alias Score {
var %T = $ini(zombie.ini,0)
.window -c @Score
.window -h @Score
while %T {
var %Player = $ini(zombie.ini,%T)
aline @score $+(%Player,=,$readini(zombie.ini,%Player,$1))
dec %T
}
.filter -wwctue 2 61 @Score @Score *=*
var %x = $gettok($line(@Score,1),1,61), %y = $fline(@Score,$+($2,=*)), %z = $gettok($line(@Score,$2),1,61)
if $isid {
if $prop = rank { return %y }
if $prop = name { return %z }
if $prop = total { return $ini(zombie.ini,0) }
if $1 = kills {
if $prop = timer { msg # 04Top Killer 07is currently:04 %x | halt }
if $prop = new { msg # 04Top Killer 07is now:04 %x | halt }
return %x
}
if $1 = cash {
if $prop = timer { msg # 04Richest Player 07is currently:04 %x | halt }
if $prop = new { msg # 04Richest Player 07is now:04 %x | halt }
return %x
}
}
}
alias Rank {
if !$regex($1,/(kills|cash|level|xp)/) { %m rank [kills|cash|level|xp] [NAME|NUM] | halt }
if $2 !isnum || !$2 {
var %x = $iif($2,$2,$nick)
%m $I($ini(zombie.ini,$ini(zombie.ini,%x))) is ranked $I($ord($score($1,%x).rank)) of $I($bytes($score().total,b)) players with $I($bytes($readini(zombie.ini,%x,$1),b) $1)
}
else %m $I($score($1,$2).name) is ranked $I($ord($2)) of $I($bytes($score().total,b)) players with $I($bytes($readini(zombie.ini,$score($1,$2).name,$1),b) $1)
}
alias -l C1 { return $+(14,$1-) }
alias -l C2 { return $+(04,$1-,$C1) }
alias -l C { return $+(,$hget($nick,c1),$1-) }
alias -l I { return $+(,$hget($nick,c2),$1-,$C) }
evilMonkey capture showing the problem of colors -> http://imageshack.us/f/804/capturerek.png/
Annaiidziithaa is ranked th of players with cash
Annaiidziithaa is ranked st of players with level
evilMonkey good!, I can see the messages by putting the command that you mentioned, but you should correct the following colors that interferes and can not display the position in number, should appear so ->
Annaiidziithaa is ranked "6th" of players with 25 cash
Annaiidziithaa is ranked "1st" of players with 1 level
alias -l C1 { return $+(14,$1-) }
alias -l C2 { return $+(04,$1-,$C1) }
alias -l C { return $+(,$hget($nick,c1),$1-) }
alias -l I { return $+(,$hget($nick,c2),$1-,$C) }
on these 4 lines, simply remove the colors and it works perfectly
it should appear as follows:
alias -l C1 { return $+($1-) }
alias -l C2 { return $+($1-,$C1) }
alias -l C { return $+($hget($nick,c1),$1-) }
alias -l I { return $+($hget($nick,c2),$1-,$C) }