I have this code that took the tats and want to switch to st5, I know it is possible and I tried but it dosen't work.
can you halp me please?
;########################################################
;# JO-KEN-PO Settings. #
;########################################################
alias jkp.preparing {
var %hand = $rand(1,99)
var %s = $rand(1,100)
if (%hand > 0 && %hand <= 70) { thset jkpbet $rand(50,1000) }
else { thset jkpbet $rand(50,1000) }
thset jkptotal 0
if (%mao > 0 && %mao <= 33) { thset jkp.win rock | thset jkp.lose paper | thset myplay scissors }
elseif (%hand > 33 && %han <= 66) { thset jkp.win paper | thset jkp.lose scissors | thset myplay rock }
else { thset jkp.win scissors | thset jkp.lose rock | thset myplay paper }
mstat *s4 $stm Special game - Jo-Ken-Po - maximum bet: $thget(jkpbet) !
choose between rock , Paper or scissors. • Paper beat Rock, rocks beat scissors, and scissors beats Paper.
Use scissors, paper or rocks + points - Ex. rocks 50; scissors 25; paper 30
}
alias processjkp {
if ($th2(jkp) == $null) {
if ($2) {
if ($2 isnum) {
if ($2 > 0 && $2 <= $thget(jkpbet)) {
if ($2 <= $user.score($nick)) {
thset jkptotal $calc($thget(jkptotal) + 1)
thset JTemp.jkp. $+ $thget(jkptotal) $nick
if ($1 isin $thget(jkp.win)) {
thuset2 jkp win
thuset2 jbet $2
}
elseif ($1 isin $thget(jkp.lose)) {
thuset2 jkp lose
thuset2 jbet $calc((-1) * $2)
}
else {
thuset2 jkp tie
thuset2 jbet 0
}
mstat *s4 $stm • $nick • you play well - you choose $1 and bet $2 points! Now you have to wait (Y)
}
else { .msg $chan $nick , sorry, but you can not bet more that you have! }
}
else { .msg $chan $nick You have to bet 1 and $thget(jkpbet) $+ ! }
}
else { .msg $chan the bet has to be a number, $nick ! }
}
else { .msg $chan You should bet a value, $nick ! Ex. rocks 35 }
}
else { .msg $chan Hey, $nick , you already betting;) }
}
alias jkpscore {
mstat *s4 $stm (O) Betting closed! I chose • $thget(myplay) • (yn)
(I) Congrats to who won! - nice try for those who made a tie! - And who lost,next time is better (i)
%ij = 1
.timer.jkp. $+ $cid -m 0 500 jkpinc jkp. $+ $cid
}
alias jkpinc {
if ($thget($eval(JTemp.jkp. $+ %ij,1)) == $null) {
.timer. $+ $1 off
unset %ij
hdel -w Trivia $+ $idenn JTemp.*
}
else {
thset jtemp.cng $thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1))
setvar $thget($eval(JTemp.jkp. $+ %ij,1)) Score $calc($realvar($thget($eval(JTemp.jkp. $+ %ij,1)), Score) + $thget(jtemp.cng))
thset $eval(Score. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1) $calc($thget($eval(Score. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)) + $thget(temp.cng))
if ($thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)) == 0) {
mstat *s4 $stm $thget($eval(JTemp.jkp. $+ %ij,1)) : (*) $thget($eval(JTemp.jkp. $+ %ij,1)) (*) empatou, ou seja, nÃão ganhou mas tambÃém nÃão perdeu!
}
else {
mstat *s4 $stm $thget($eval(JTemp.jkp. $+ %ij,1)) : (*) $thget($eval(JTemp.jkp. $+ %ij,1)) (*) $iif($thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)) > 0,ganhou $thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)), perdeu $calc($thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)) * -1)) ponto $+ $iif($thget($eval(JTemp.jbet. $+ $thget($eval(JTemp.jkp. $+ %ij,1)),1)) != 1,s) $+ ! Total de pontos: $user.score($thget($eval(JTemp.jkp. $+ %ij,1)))
}
inc %ij
}
}
and i put this in section " handling normal input " in st5.0
on *:TEXT:*:#:{
if (rock isin $1 || scissors isin $1 || paper isin $1) {
processjkp $1-
}
}
any help is welcome,please
thanks