rendered paste body#scrambler off
on *:text:%sc.ans:%s.chan {
if ($dialog(scram) == $null) { .disable #scrambler | unset %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %s.chan %id1l %winner %winnerco %templ %big %templl %filternick | halt }
.disable #scrambler
msg %s.chan [ الإجابة ] @}-- $+ ـ‌‌‌ـ $nick ـ‌‌‌ـ $+ --{@ [ $+ %sc.ans $+ ]
did -rf scram 7
did -ra scram 6 أدخل الاجابة الصحيحة
:check
inc %temp.line
if ($did(scram,1,%temp.line) == $null) || ($did(scram,1).lines == 0) { goto end }
if ($nick == $filternick) { set %temp.nick $remove($did(scram,1,%temp.line),«»,$nick) | did -oc scram 1 %temp.line $nick «» $calc(%temp.nick + 1) | unset %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %templ %id1l %winner %winnerco %big %filternick %templl | halt }
goto check
:end
did -ac scram 1 $nick «» 1
unset %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %templ %id1l %winner %winnerco %big %filternick %templl
}
#scrambler end
alias -l scramble unset %sc.* | %sc.w = 1 | :1 | inc %sc.i | if (%sc.i > $len($gettok($did(7),%sc.w,32))) goto 2 | %sc.ls = %sc.ls $mid($gettok($1-,%sc.w,32),%sc.i,1) | goto 1 | :2 | %sc.l = $r(1,$gettok(%sc.ls,0,32)) | if (%sc.i) { %sc.wrd = %sc.wrd $gettok(%sc.ls,%sc.l,32) | unset %sc.i } | else %sc.wrd = %sc.wrd $+ $gettok(%sc.ls,%sc.l,32) | if ($len($gettok(%sc.wrd,%sc.w,32)) == $len($gettok($did(7),%sc.w,32))) { if ($len(%sc.wrd) == $len($did(7))) return %sc.wrd | inc %sc.w | %sc.ls = "" | goto 1 } | %sc.ls = $deltok(%sc.ls,%sc.l,32) | goto 2
alias scram dialog -mn scram scram
dialog scram {
title "Scramble Game"
size -1 -1 330 155
list 1,185 5 140 120,sort,extsel,size
text "الجنل",2,5 2 50 12,left
edit "",3,5 15 175 22,autohs
text "السؤال",4,5 46 50 12,left
edit "",5,5 59 175 22,autohs
text "الجواب",6,5 89 175 14,left
edit "",7,5 103 120 22,autohs
button "إبدأ",8,130 104 50 20
button "النقاط",9,185 130 47 20
button "مسح الكل",10,278 130 47 20
button "إغلاق",11,5 130 85 20,ok
button "مسح",12,232 130 47 20
button "إعلان الفائز",13,95 130 85 20
}
on *:dialog:scram:init:0:.disable #scrambler | unset %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %s.chan %id1l %templ %big %winner %winnerco | if ($active ischan) { did -a scram 3 $active | set %s.chan $active }
on *:dialog:scram:sclick:*:{
if ($did == 8) { if ($did(7) == $chr(32)) { did -rf scram 7 | halt } | if ($did(3) == $null) { did -f scram 3 | halt } | if ($did(5) == $null) { did -f scram 5 | halt } | if ($did(7) == $null) { did -f scram 7 | halt } | .enable #scrambler | msg $did(3) ـ‌‌‌ـ الجواب ـ‌‌‌ـ :--=> $scramble($did(7)) | %sc.ans = $did(7) | msg $did(3) ـ‌‌‌ـ السؤال ـ‌‌‌ـ :--=> $did(5) | did -ra scram 6 الجواب = %sc.ans | halt }
if ($did == 9) && ($did(1).lines >= 1) { set %temp.line 0 | :point | inc %temp.line | if ($did(1,%temp.line) == $null) { goto end } | %points = %points $+ [ $+ $did(1,%temp.line) $+ ] | goto point | :end | msg $did(3) عدد النقاط: %points | unset %temp.line %points }
if ($did == 10) && ($did(1).lines >= 1) { inc %undo | if (%undo >= 2) { goto clear } | dialog -t scram If you are sure click RESET again now. | .timer 1 10 dialog -t scram Scramble Game v1.0 | .timer 1 10 unset %undo | halt | :clear | did -r scram 1 | did -r scram 5 | did -r scram 7 | did -ra scram 6 الجواب | dialog -t scram Scramble Game v1.0 | unset %undo }
if ($did == 11) { .disable #scrambler | unset %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %s.chan %id1l %templ %big %winner %winnerco %templl %filternick %id1l %undo }
if ($did == 12) && ($did(1).sel != $null) { inc %undo | if (%undo >= 2) { goto rem } | dialog -t scram If you are sure click REMOVE again now. | .timer 1 10 dialog -t scram Scramble Game v1.0 | .timer 1 10 unset %undo | halt | :rem | did -d scram 1 $did(1).sel | dialog -t scram Scramble Game v1.0 | unset %undo }
if ($did == 13) && ($did(1).lines >= 2) {
set %templ 0
set %big 0
:win
inc %templ
if ($id1l == $null) { set %templ 0 | goto check }
if ($winnerco > %big) { set %big $winnerco | set %winner $id1l | %templl = %templ | goto win }
goto win
:check
inc %templ
if ($id1l == $null) { goto end }
if ($id1l == %winner) { goto check }
if ($winnerco == %big) { dialog -t scram No winner untill now. | .timer 1 5 dialog -t scram Scramble Game v1.0 | unset %templ %winnerco %big %id1l %winner %templl | halt }
goto check
:end
msg $did(3) ـ‌‌‌ــ‌‌‌The WinneR is $+ %winner $+ ‌‌‌ــ‌‌‌ـ | did -c scram 1 %templl
.disable #scrambler
unset %templ %winnerco %big %id1l %winner %temp.line %temp.nick %temp.00 %sc.ans %sc.wrd %sc.w %sc.ls %sc.i %sc.l %templl
did -rf scram 5 | did -r scram 7 | did -ra scram 6 Word
}
}
alias id1l %id1l = $did(scram,1,%templ) | return %id1l
alias winnerco %winnerco = $mid($did(scram,1,%templ),$pos($did(scram,1,%templ),$chr(32),2),4) | return %winnerco
alias filternick %filternick = $mid($did(scram,1,%temp.line),1,$pos($did(scram,1,%temp.line),$chr(32),1)) | return %filternick
menu channel {
-
|- سكرامبل -| { %s.chan = # | scram }
-
}