|
|
| Poster |
Thread |
| CrazyGirl |
Posted on: 2010/2/10 22:00 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message the solution is:
alias -l getboxes {
; $1 = chan
if ( !$1 ) return
var %f = $boxes, %a = 6, %b = 5, %c = 1, %d, %h, %j = 0
while %a {
%d = $gettok(%f,$r(1,$numtok(%f,44)),44)
hadd -m $tbl $+(boxes:,$1,:1) $hget($tbl,$+(boxes:,$1,:1)) $+($iif(%j < 3,good,bad),:,%d,:,$+($iif($r(1,2) == 2,-),$r($score.min,$score.max)))
hadd $tbl $+(boxes:,$1,:2) $hget($tbl,$+(boxes:,$1,:2)) %d
hadd $tbl $+(boxes:,$1,:3) $hget($tbl,$+(boxes:,$1,:3)) %d
%f = $remtok(%f,%d,1,44)
inc %j
dec %a
}
return $sorttok($hget($tbl,$+(boxes:,$1,:2)),32)
}
alias -l startboxes {
; $1 = chan, $2 = roundlimit
var %a = $chan_
if ( $2 ) hadd -m $tbl $+(rounds:,,:limit) $2
if ( $hget($tbl,$+(rounds:,%a,:limit)) ) {
hinc $tbl $+(rounds:,%a,:current) 1
msg %a ** ROUND $hget($tbl,$+(rounds:,%a,:current)) of $hget($tbl,$+(rounds:,%a,:limit)) **
}
msg %a Each box is worth a certain score and can be chosen only once. You must enter one of the following box available. Be careful, as there are empty boxes
tokenize 32 $getboxes(%a)
msg %a The boxes available are: 12,08 $1 08,12 $2 12,08 $3 08,12 $4 12,08 $5 08,12 $6
$+(.timerboxes.,%a,.END) 1 $time.limit endboxes $!chan_ 1
}
alias -l endboxes {
var %a = $chan_
if ( $timer($+(boxes.,$chan_,.END)) ) $+(.timerboxes.,$chan_,.END) off
if ( !$2 ) $+(.timerboxes.,$chan_,.*) off
var %t = %a, %e = $2
if ( %e ) {
msg $chan_ Box A: ( $+ $getscoreorempty($chan_,A) $+ ) Box D: ( $+ $getscoreorempty($chan_,D) $+ )
msg $chan_ Box B: ( $+ $getscoreorempty($chan_,B) $+ ) Box E: ( $+ $getscoreorempty($chan_,E) $+ )
msg $chan_ Box C: ( $+ $getscoreorempty($chan_,C) $+ ) Box F: ( $+ $getscoreorempty($chan_,F) $+ )
}
scorenickboxes $chan_ %e
}
alias -l getboxescore {
var %a = $hfind($tbl,$+(*:,$2,:*),0,w).data, %b
while %a {
if ( $chan_ == $gettok($hfind($tbl,$+(*:,$2,:*),%a,w).data,2,58) ) return $gettok($wildtok($hget($tbl,$+(boxes:,$v2,:1)),$+(*:,$2,:*),1,32),3,58)
dec %a
}
}
;$getboxescore(#chan,box)
alias -l getscoreorempty return $iif($goodorbadbox($chan_,$2) == bad,Empty,$getboxescore($chan_,$2))
;$getscoreorempty(#chan,box)
alias -l getnickscore return $iif($hget($tbl,scores: $+ $iif($2,$+($1,:,$2),$1)),$v1,0)
;$getnickscore(nick,[#chan]) {
|
|
|
| FireHorse |
Posted on: 2010/2/9 9:55 |
Webmaster   Joined: 1970/1/1 From: Posts: 1 |
Re: Message Thanks for sharing the solution!
|
|
|
| CrazyGirl |
Posted on: 2010/2/8 18:27 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message no,is not this game, is another one that i made, but after 2 days, i found the way the game work :woot: :woot: :dance2: thanks to all
|
|
|
| Pk |
Posted on: 2010/2/7 22:04 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message Is your snippet part code for the game deal or no deal???? I found a code for Deal or no Deal Game. Not written by me but hope this helps... Deal or no Deal CodeCheers Pk
|
|
|
| FireHorse |
Posted on: 2010/2/5 11:19 |
Webmaster   Joined: 1970/1/1 From: Posts: 1 |
Re: Message this code is incomplete as it makes no sense, there are no trigger events
Quite often I have found it is quicker for me to code a game than try to fix something that is not working
If you want help you need to give a clear outline of what the code is supposed to do and what you have tried to change to get it to work
FireHorse
|
|
|
| CrazyGirl |
Posted on: 2010/2/4 14:43 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message no, doesn't work
|
|
|
| Da®K |
Posted on: 2010/2/4 12:15 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message tries to use $1 = %chan I used thus in my archive and I functioned :dance:
|
|
|
| CrazyGirl |
Posted on: 2010/2/4 8:45 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message I tried to remove ; and change this $1 = chan and this, $1 = #chan but still not working
|
|
|
| Pk |
Posted on: 2010/2/4 6:34 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Re: Message Most codes with a ; at the start of the line will stop that line of code.
|
|
|
| CrazyGirl |
Posted on: 2010/2/3 10:04 |
Just popping in   Joined: 1970/1/1 From: Posts: 0 |
Message i have this game, but the messages don't appear, I think it's because of this ; $1 = chan or this ;$getboxescore(#chan,box) there is a possibility of change for msg #? thanks
alias -l getboxes {
; $1 = chan
if ( !$1 ) return
var %f = $boxes, %a = 6, %b = 5, %c = 1, %d, %h, %j = 0
while %a {
%d = $gettok(%f,$r(1,$numtok(%f,44)),44)
hadd -m $tbl $+(boxes:,$1,:1) $hget($tbl,$+(boxes:,$1,:1)) $+($iif(%j < 3,good,bad),:,%d,:,$+($iif($r(1,2) == 2,-),$r($score.min,$score.max)))
hadd $tbl $+(boxes:,$1,:2) $hget($tbl,$+(boxes:,$1,:2)) %d
hadd $tbl $+(boxes:,$1,:3) $hget($tbl,$+(boxes:,$1,:3)) %d
%f = $remtok(%f,%d,1,44)
inc %j
dec %a
}
return $sorttok($hget($tbl,$+(boxes:,$1,:2)),32)
}
alias -l startboxes {
; $1 = chan, $2 = roundlimit
var %a = $1
if ( $2 ) hadd -m $tbl $+(rounds:,$1,:limit) $2
if ( $hget($tbl,$+(rounds:,$1,:limit)) ) {
hinc $tbl $+(rounds:,$1,:current) 1
msg $1 ** ROUND $hget($tbl,$+(rounds:,$1,:current)) of $hget($tbl,$+(rounds:,$1,:limit)) **
}
msg $1 Each box is worth a certain score and can be chosen only once. You must enter one of the following box available. Be careful, as there are empty boxes
tokenize 32 $getboxes($1)
msg %a The boxes available are: $1 $2 $3 $4 $5 $6
$+(.timerboxes.,%a,.END) 1 $time.limit endboxes %a 1
}
alias -l endboxes {
if ( $timer($+(boxes.,$1,.END)) ) $+(.timerboxes.,$1,.END) off
if ( !$2 ) $+(.timerboxes.,$1,.*) off
var %t = $1, %e = $2
if ( %e ) {
msg %t Box A: ( $+ $getscoreorempty(%t,A) $+ ) Box D: ( $+ $getscoreorempty(%t,D) $+ )
msg %t Box B: ( $+ $getscoreorempty(%t,B) $+ ) Box E: ( $+ $getscoreorempty(%t,E) $+ )
msg %t Box C: ( $+ $getscoreorempty(%t,C) $+ ) Box F: ( $+ $getscoreorempty(%t,F) $+ )
}
scorenickboxes %t %e
}
alias -l getboxescore {
var %a = $hfind($tbl,$+(*:,$2,:*),0,w).data, %b
while %a {
if ( $1 == $gettok($hfind($tbl,$+(*:,$2,:*),%a,w).data,2,58) ) return $gettok($wildtok($hget($tbl,$+(boxes:,$v2,:1)),$+(*:,$2,:*),1,32),3,58)
dec %a
}
}
;$getboxescore(#chan,box)
alias -l getscoreorempty return $iif($goodorbadbox($1,$2) == bad,Empty,$getboxescore($1,$2))
;$getscoreorempty(#chan,box)
alias -l getnickscore return $iif($hget($tbl,scores: $+ $iif($2,$+($1,:,$2),$1)),$v1,0)
;$getnickscore(nick,[#chan])
|
|
|
|