Oper Sandtrap Dialog

By TehJibba on Feb 02, 2011

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  }
}

Comments

Sign in to comment.
TehJibba   -  Feb 05, 2011

this has been updated ages ago :) just incase peeps didnt notice :P

 Respond  
Jamiie   -  Feb 04, 2011

Getting the error: WARNING! You must fill out all 3 inputs and press set for each input! Try Agian Please. And I fill out all in order from top to bottom, while pressing set for each one.

 Respond  
TehJibba   -  Feb 02, 2011

just happen to like dialogs. $input could be substituted tho if u prefer it.

 Respond  
_Dean_   -  Feb 02, 2011

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) 
 Respond  
TehJibba   -  Feb 02, 2011

whoops on the bracket mis copied it sorry. And ill add a server setup in just a few mins. just threw it together this after noon :P

 Respond  
_Dean_   -  Feb 02, 2011

closing Bracket missed in "on part" event, by the way, if for a coincidence, its on and the same nick is in another network, and the user running the code its not IRCop on this network?

u need to check, if the user with the code is with IRCop Flags

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.