; Done, Visit #rattmuffen @ quakenet
menu menubar,channel {
Imitate:/imitate
}
alias imitate { /dialog -m imitate imitate }
dialog imitate {
title "Imitatescript (/imitate)"
size -1 -1 97 42
option dbu
edit "", 1, 24 2 69 12
text "nick:", 2, 10 4 14 8
check "Imitate on/off", 3, 19 29 41 10
button "Imitate!", 4, 63 29 30 10, ok
edit "", 5, 24 15 69 12
text "#Channel:", 6, 4 18 20 8
}
on *:DIALOG:imitate:sclick:*:{
if ($did == 4) { set %hnick $did($dname,1) | set %hkanal $did($dname,5) }
if ($did == 7) { unset %haerma | unset %hkanal | unset %hnick }
if ($did == 3) && (%haerma == on) { set %haerma off }
elseif ($did == 3) && (%haerma == off) { set %haerma on }
}
on *:DIALOG:imitate:init:*:{
did -a $dname 1 %hnick
did -a $dname 5 %hkanal
if (%haerma == on) { did -c $dname 3 }
if (%haerma == off) { did -u $dname 3 }
if ($did(1).text == $null) && ($did(5).text == $null) { did -b $dname 4 }
}
on *:DIALOG:imitate:edit:*:{
if ($did(1).text == $null) || ($did(5).text == $null) { did -b $dname 4 }
elseif ($did(1).text) || ($did(5).text) { did -e $dname 4 }
}
on *:TEXT:*:%hkanal:{ if ($nick == %hnick) && (%haerma == on) { msg %hkanal $1- } }
}
on *:LOAD:{
set %haerma off
echo -a Script succesfully loaded, visit #rattmuffen
}
u dnt need to use $did($dname,1) while ur in the dialog sub...just $did(1),in the variable set... here
elseif ($did == 3) && (%haerma == off) { set %haerma on }
will be better and shorter in code if its like :
elseif ($did == 3) && (!%haerma) { set %haerma 1}
u dnt need to set on and off...just any value and check if the variable isnt null .... like what u did here :
if (%haerma == on) { did -c $dname 3 }
if (%haerma == off) { did -u $dname 3 }
u should have done it like :
if (%haerma) { did -c $dname 3 }
else { did -u $dname 3 }
otherthan this its workin properly..btw u wrote a variable in a wrong way in that line :
if ($did == 7) { unset %herma | unset %hkanal | unset %hnick }
replace %herma...goodluck