Simple sandtrap setup. Right now is for only a single user but i will be adding the ability to setup traps for diff peeps with diff time lengths. as well as closing any loopholes such as quiting.
*note some may consider this an "evil" script, idc. its fun when people can take a joke
EDIT
redid the script slightly so it was easier to use. no more setting each var on its own its all done when u click the sandtrap button.
also used inputs instead of dialogs as was suggested here as well as from a few other users on my network.
cleaned it up a bit and condensed it a little.
menu * {
-
Sandtrap:{
if (%stserver == On) { _sandtrap }
else { _stserver }
}
-
}
alias _ststop { dialog -md ststop ststop }
dialog ststop {
title "End Sandtrap"
size -1 -1 74 31
option dbu
text "Sandtrap Currently Running. To stop it click Stop It", 1, 1 1 71 16, center
button "Stop It", 2, 19 19 37 10
}
alias _stserver { dialog -md stserver stserver }
dialog stserver {
title "Server for ST"
size -1 -1 135 38
option dbu
text "Please enter the network name for the server you are oper on. To find out what it is type //echo -a $network and enter the result.", 1, 2 3 130 19, center
edit "", 2, 11 25 69 10
button "Continue", 3, 82 25 37 10
}
alias _sandtrap { dialog -md sandtrap sandtrap }
dialog sandtrap {
title "Oper Sandtrap"
size -1 -1 100 48
option dbu
edit "", 1, 2 3 56 10
text "Nick To Trap", 2, 61 4 32 8
edit "", 3, 2 14 56 10
text "Chan For Trap", 4, 60 15 38 8
edit "", 5, 2 25 56 10
text "Length Of Trap", 6, 59 26 39 8
button "Sandtrap 'em", 7, 25 37 50 9
}
on *:dialog:ststop:sclick:2: { .timer 1 1 unset %st.* | .timer 1 1 dialog -x ststop }
on *:dialog:stserver:sclick:3: { set %stserver On | set %stnetwork $did(2).text | .timer 1 0 dialog -x stserver | .timer 1 0 _sandtrap }
on *:dialog:sandtrap:sclick:7: {
if ($did(1) != $null) { set %st.nick $did(1).text }
else { noop $input(WARNING! Please enter a valid nick to use,o,WARNING) }
if (($did(3) != $null) && ($chr(35) !isin $did(3).text)) { set %st.chan $chr(35) $+ $did(3).text }
else { noop $input(WARNING! Please enter a channel name in the proper format. This means just the name without the # infront of it,o,WARNING) }
if (($did(5) != $null) && ($did(5).text isnum)) { set %st.length .timer 1 $did(5).text }
else { noop $input(WARNING! Must be a number,o,WARNING) }
if ((%st.chan != $null) && (%st.nick != $null) && (%st.length != $null) && ($network == %stnetwork)) {
.timer 1 0 set %st.pwn On
.timer 1 0 join %st.chan
.timer 1 0 dialog -x sandtrap
.timer 1 1 _ststop
.timer 1 1 topic %st.chan Welcome to the trap %st.nick Enjoy your stay :P
.timer 1 1 sajoin %st.nick %st.chan
%st.length part %st.chan
%st.length unset %st.*
}
else { noop $input(WARNING! You must fill out all 3 inputs and press set for each input! Try Again Please,o,WARNING) }
}
on *:part:#: {
if ((%st.pwn == On) && ($nick == %st.nick) && ($chan == %st.chan) && ($network == %stnetwork)) { sajoin %st.nick %st.chan }
}
on *:join:#: {
if (($nick == %st.nick) && (%st.pwn == On) && ($network == %stnetwork) && ($chan != %st.chan)) { .timer 1 1 sajoin %st.nick %st.chan }
}
why dont you use $input instead create new dialogs?
like
noop $input(WARNING! Must be a number,o,WARNING)
noop $input(WARNING! Please enter a valid nick to use,o,WARNING)
noop $input(WARNING! You must fill out all 3 inputs and press set for each input! Try Again Please,o,WARNING)
noop $input(WARNING! Please enter a channel name in the proper format. This means just the name without the # infront of it,o,WARNING)