Login

Username:

Password:


Lost Password?
Forum Index   -   Topic Index
   Scripting
     Fruit Game Help
Register To Post

Flat Previous Topic | Next Topic
Poster Thread
Diego
Posted on: 2010/2/8 22:22
Just popping in
Joined: 1970/1/1
From:
Posts: 0
Fruit Game Help
alias fruit.preparing {
var %
x $fruit.sort
Fruit Game Minimum w 
play10 points
Rules
Each fruit is worth a certain score and may be selected only onceYou must enter one of the following fruit availableBe carefulsince it has rotten fruit =)â?© â?º :: %:: 

}
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 == 5thset nfruits $rand(7,8)
else 
thset nfruits $rand(3,6)
;
thset nfruits $rand(7,8)
%
$iif($thget(nfruits) > 4,a,$rand(a,c))
%
$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)
%
â?¢ ï? $+ $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 (%
<= $thget(nfruits)) {
%
$fruit.getfree(30,%s)
%
$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) == $nullthset 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) == $nullthset 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) $+ ï?©
}
%
= %%u
%= %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,10points to play this game!! | return }
%
$fruit.resp
if ($nick isin $thget(fplayed)) {
tsay S Arial;0 Hey$nickvocec ja made his move;) ï ?<(*) You picked the fruit[ $+ $fruitplayed $+ ](*)
return
}
var %
i 1
while (%<= $thget(nfruits)) {
if ($
== $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) >= 100thset powerwinner $nick
tsay S Arial
;$+ (*) $nick (*) you chose the fruit [ $+ $$+ ]. Wait for the round to be completed (O
}
else {
%
1
while (%<= $thget(nfruits)) {
if (
$token($thget(fruit $+ %j),3,32) == $null) %= %k $token($thget(fruit $+ %j),1,32)
inc %j
}
tsay S Arial;$+ (*) $nick (*) fruit $token($thget(fruit $+ %i),1,32has 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(powerwinnerchose the mega fruit$upper($thget(megafruit)) $+ ! Won $iif($thget(nfruits) == 7,100,125points! :: [â?«],ï??â?º ::Nobody chose the mega fruit $upper($thget(megafruit)) was worth $iif($thget(nfruits) == 7,100,125points! :: [â?«])) 

;
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(powerwinnerchose the mega fruit $upper($thget(megafruit)) $+ ! Won $iif($thget(nfruits) == 7,100,125points! :: [â?«],ï??â?º :: Nobody chose the mega fruit $upper($thget(megafruit)) was worth $iif($thget(nfruits) == 7,100,125points! :: [â?«])) 
var %
i 1
while (%<= $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,32Score $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,32Score 0
thset $eval
(Score. $+ $token($thget(fruit $+ %i),3,32),10
}
if (
$thget(ftemp.cng) == 0) {
if (%
6tsay (*) $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;(*) $token($thget(fruit $+ %i),3,32) (*) chose fruit  $token($thget(fruit $+ %i),1,32) and not earned points! ;) 
}
else {
if (%
6tsay (*) $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;(*) $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 (%<= $thget(nfruits)) {
if ($
== $token($thget(fruit $+ %i),1,32)) return $true
inc 
%i
}
return 
$false
}
alias -l fruitplayed {
var %
i 1
while (%<= $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 %
= $2-, %$r(1,$1)
while (
$istok(%a,%b,32)) {
var %
$r(1,$1)
}
return %
b
}
Flat Previous Topic | Next Topic

Subject Poster Date
 » Fruit Game Help Diego 2010/2/8 22:22
     Re: Fruit Game Help FireHorse 2010/2/9 9:54
       Re: Fruit Game Help Diego 2010/2/9 13:17
         Re: Fruit Game Help Diego 2010/2/9 17:29
           Re: Fruit Game Help Diego 2010/2/13 0:28
             Re: Fruit Game Help FireHorse 2010/2/20 8:19
               Re: Fruit Game Help Diego 2010/2/20 16:15
                 Re: Fruit Game Help Da®K 2010/2/22 8:08
                   Re: Fruit Game Help FireHorse 2010/2/23 11:31
                     Fruit Game Diego 2010/2/24 13:00

Register To Post