alias fruit.preparing {
var %x $fruit.sort
Fruit Game Minimum w / play: 10 points
Rules: Each fruit is worth a certain score and may be selected only once. You must enter one of the following fruit available. Be careful, since it has rotten fruit =)â?© â?º :: %x ::
}
alias fruit.sort {
var %s $rand(1,30), %i 2,%u,%v,%t,%t2,%r,%r2
thset megafruit
thset goodfruits
thset badfruits
thset fplayed
thset powerwinner
%r2 = $rand(1,9)
if (%r2 == 5) thset nfruits $rand(7,8)
else thset nfruits $rand(3,6)
;thset nfruits $rand(7,8)
%r = $iif($thget(nfruits) > 4,a,$rand(a,c))
%t = $rand(1,$thget(nfruits))
%t2 = %t
;thset nfruits $rand(7,8)
thset fruit1 $readini(fruit.ini,fruits,%s) $readini(fruit.ini,nvl $+ $thget(nfruits) $+ %r,%t)
%v = â?¢ ï? $+ $token($thget(fruit1),1,32) $+ ]
if ($token($thget(fruit1),2,32) >= 100) { thset megafruit $token($thget(fruit1),1,32) }
elseif ($token($thget(fruit1),2,32) > 0) { thset goodfruits $token($thget(fruit1),1,32) $+ ( $+ $token($thget(fruit1),2,32) $+ ) }
else { thset badfruits $token($thget(fruit1),1,32) $+ ( $+ $token($thget(fruit1),2,32) $+ ï?© }
while (%i <= $thget(nfruits)) {
%u = $fruit.getfree(30,%s)
%t = $fruit.getfree($thget(nfruits),%t2)
%t2 = %t2 %t
thset $+(fruit,%i) $readini(fruit.ini,fruits,%u) $readini(fruit.ini,nvl $+ $thget(nfruits) $+ %r,%t)
if ($token($thget(fruit $+ %i),2,32) >= 100) { thset megafruit $token($thget(fruit $+ %i),1,32) }
elseif ($token($thget(fruit $+ %i),2,32) > 0) {
if ($thget(goodfruits) == $null) thset goodfruits $token($thget(fruit $+ %i),1,32) $+ ( $+ $token($thget(fruit $+ %i),2,32) $+ )
else thset goodfruits $thget(goodfruits) $+ , $token($thget(fruit $+ %i),1,32) $+ ( $+ $token($thget(fruit $+ %i),2,32) $+ ï?©
}
else {
if ($thget(badfruits) == $null) thset badfruits $token($thget(fruit $+ %i),1,32) $+ ( $+ $token($thget(fruit $+ %i),2,32) $+ )
else thset badfruits $thget(badfruits) $+ , $token($thget(fruit $+ %i),1,32) $+ ( $+ $token($thget(fruit $+ %i),2,32) $+ ï?©
}
%s = %s %u
%v = %v â?¢ ï? $+ $token($thget(fruit $+ %i),1,32) $+ ]
inc %i
}
;echo -a $thget(nfruits)
;echo -a a $thget(megafruit)
;echo -a $thget(goodfruits)
;echo -a $thget(badfruits)
return %v â?¢
}
alias processfruit {
var %x,%j,%k
if (!$isfruit($1-)) return
if (!$user.score($nick) || $user.score($nick) < $iif($thget(nfruits) > 6,25,10)) { tsay Hey, $nick , you must have at least $iif($thget(nfruits) > 6,25,10) points to play this game!! | return }
%x = $fruit.resp
if ($nick isin $thget(fplayed)) {
tsay S Arial;0 Hey, $nick, vocec ja made his move;) ï ?<(*) You picked the fruit[ $+ $fruitplayed $+ ](*)
return
}
var %i 1
while (%i <= $thget(nfruits)) {
if ($1 == $token($thget(fruit $+ %i),1,32)) {
if ($token($thget(fruit $+ %i),3,32) == $null) {
thset fplayed $thget(fplayed) $nick
thset $+(fruit,%i) $thget(fruit $+ %i) $nick
if ($token($thget(fruit $+ %i),2,32) >= 100) thset powerwinner $nick
tsay S Arial;0 $+ (*) $nick (*) you chose the fruit [ $+ $1 $+ ]. Wait for the round to be completed (O)
}
else {
%j = 1
while (%j <= $thget(nfruits)) {
if ($token($thget(fruit $+ %j),3,32) == $null) %k = %k $token($thget(fruit $+ %j),1,32)
inc %j
}
tsay S Arial;0 $+ (*) $nick (*) fruit $token($thget(fruit $+ %i),1,32) has already been chosen by $token($thget(fruit $+ %i),3,32) $+ . Fruit available: $iif(%k,%k,Nenhum)
}
}
inc %i
}
}
alias fruitscore {
tsay S Arial;0 â??â? â?¼â?£â?¢ Fruit Game Finishedâ?¢â? â?¼â?£â??
tsay S Arial;0 â??â? â?¼â?£â?¢ [Good Fruit / Mature] :: $thget(goodfruits) â?¢â? â?¼â?£â??
tsay S Arial;0 â??â? â?¼â?£â?¢ [Rotten Fruit] :: $thget(badfruits) â?¢â? â?¼â?£â?? $iif($thget(nfruits) > 6,$iif($thget(powerwinner) != $null,ï??â?º :: $thget(powerwinner) chose the mega fruit$upper($thget(megafruit)) $+ ! Won $iif($thget(nfruits) == 7,100,125) points! :: [â?«],ï??â?º ::Nobody chose the mega fruit $upper($thget(megafruit)) was worth $iif($thget(nfruits) == 7,100,125) points! :: [â?«]))
;tsay S Arial;0 â??â??[ $+ $thget(Current) $+ ] :: ï? Fruit Game Finished ] ::â??â??ï??â?º [Good Fruit / Mature] :: $thget(goodfruits) :: [â?ª] ï??â?º [Rotten Fruit] :: $thget(badfruits) :: [-] $iif($thget(nfruits) > 6,$iif($thget(powerwinner) != $null,ï??â?º :: $thget(powerwinner) chose the mega fruit $upper($thget(megafruit)) $+ ! Won $iif($thget(nfruits) == 7,100,125) points! :: [â?«],ï??â?º :: Nobody chose the mega fruit $upper($thget(megafruit)) was worth $iif($thget(nfruits) == 7,100,125) points! :: [â?«]))
var %i 1
while (%i <= $thget(nfruits)) {
if ($token($thget(fruit $+ %i),3,32) != $null) {
thset ftemp.cng $token($thget(fruit $+ %i),2,32)
if ($calc($realvar($token($thget(fruit $+ %i),3,32), Score) + $thget(ftemp.cng)) > 0) {
setvar $token($thget(fruit $+ %i),3,32) Score $calc($realvar($token($thget(fruit $+ %i),3,32), Score) + $thget(ftemp.cng))
thset $eval(Score. $+ $token($thget(fruit $+ %i),3,32),1) $calc($thget($eval(Score. $+ $token($thget(fruit $+ %i),3,32),1)) + $thget(ftemp.cng))
}
else {
setvar $token($thget(fruit $+ %i),3,32) Score 0
thset $eval(Score. $+ $token($thget(fruit $+ %i),3,32),1) 0
}
if ($thget(ftemp.cng) == 0) {
if (%i < 6) tsay (*) $token($thget(fruit $+ %i),3,32) (*) chose fruit $token($thget(fruit $+ %i),1,32) and not earned points! ;)
else .timer.fruit. $+ $cid -m 1 500 tsay S Arial;0 (*) $token($thget(fruit $+ %i),3,32) (*) chose fruit $token($thget(fruit $+ %i),1,32) and not earned points! ;)
}
else {
if (%i < 6) tsay (*) $token($thget(fruit $+ %i),3,32) (*) $iif($thget(ftemp.cng) > 0,won $thget(ftemp.cng), lost $calc($thget(ftemp.cng) * -1)) points for the choice of fruit $token($thget(fruit $+ %i),1,32) $+ ! Total points: $user.score($token($thget(fruit $+ %i),3,32))
else .timer.fruit. $+ $cid -m 1 500 tsay S Arial;0 (*) $token($thget(fruit $+ %i),3,32) (*) $iif($thget(ftemp.cng) > 0,ganhou $thget(ftemp.cng), lost $calc($thget(ftemp.cng) * -1)) points for the choice of fruit $token($thget(fruit $+ %i),1,32) $+ ! Total points: $user.score($token($thget(fruit $+ %i),3,32))
}
}
inc %i
}
}
alias -l isfruit {
var %i 1
while (%i <= $thget(nfruits)) {
if ($1 == $token($thget(fruit $+ %i),1,32)) return $true
inc %i
}
return $false
}
alias -l fruitplayed {
var %i 1
while (%i <= $thget(nfruits)) {
if ($nick == $token($thget(fruit $+ %i),3,32)) return $token($thget(fruit $+ %i),1,32)
inc %i
}
return $false
}
;alias -l fruit.fruit {
;var %a,%b,%c
;}
alias -l fruit.getfree {
var %a = $2-, %b = $r(1,$1)
while ($istok(%a,%b,32)) {
var %b = $r(1,$1)
}
return %b
}