Mass hugger/slapper

By Blitzjager on Oct 27, 2008

This is my first dialog. =D
I just wanted to screw around with a few things and figure out how to make them and this is what I ended up with.
Please leave some feedback on what I can do better (not on how useless spamhugging a channel is :P)
It is somewhat spammy. :P (Has a less spam option)

Usage: Right click> HUGZ or /HUGZ
Options:Once the dialog is open you can choose between /me Hugz and /me Slapz. And you can make all the nicks on one line so it's less spammy.
Modes:Select if you want to hug/slap regular, voiced, or op'd users. (Or a combination of them)
Channel:Select the nicks that you want to hug/slap. (Modes overrides this.)
Refresh: Refreshes the nicklist with the nicks of the active channel. It also refreshes the name of the channel that shows above the list.
Ok: Sends the hug/slap message(s)
Close: Closes it

Problems:
-Might not work if you select a mode and nobody in the chan has it (ie. +o and +v in a chan with only ops might not work) but it shouldn't message blanks anymore so I'm happy with it


Changed "Nicks" to the channel that will be msgd
Image

menu * {
  HUGZ: HUGZ_dialog
}
alias HUGZ { dialog $iif($dialog(HUGZ),-v,-m) HUGZ HUGZ }
alias HUGZ_dialog { dialog $iif($dialog(HUGZ),-v,-m) HUGZ HUGZ }
dialog HUGZ {
  title "HUGZ"
  size -1 -1 120 63
  option dbu
  text "Modes", 7, 3 2 20 9
  check "+o", 1, 3 10 13 11, push
  check "+v", 2, 23 10 13 11, push
  check "Reg", 3, 43 10 14 11, push
  text "Options", 9, 3 22 30 9
  check "Hug", 10, 3 28 19 11,
  check "Single Line", 12, 3 37 38 11,
  check "Slap", 11, 32 28 19 11,
  button "OK", 4, 3 49 13 10, flat
  button "Close", 5, 17 49 20 10, cancel
  button "Refresh", 13, 38 49 23 10, flat
  text "", 8, 65 2 50 9
  list 6, 65 11 50 50, multsel vsbar
}
on *:dialog:HUGZ:*:*: {
  var %HUGZtimer 1
  if ($devent == init) {
    did -c HUGZ 10
    set %chan [ $active ]
    did -a HUGZ 8 %chan
    var %HUGZz 1
    while (%HUGZz <= $nick(%chan,0)) {
      didtok HUGZ 6 32 $nick(%chan,%HUGZz)
      inc %HUGZz
    }
  }
  $iif($did(1).state == 1,set %o o,unset %o)
  $iif($did(2).state == 1,set %v v,unset %v)
  $iif($did(3).state == 1,set %a a,unset %a)
  $iif($did(10).state == 1,set %HugSlap Hugz,set %HugSlap Slapz)
  $iif($did(12).state == 1,set %nospam 1,unset %nospam)
  if ($devent == sclick) && ($did == 4) {
    if (%a == $null) && (%v == $null) && (%o == $null) && ($did(HUGZ,6,0).sel == 0) {
      echo -a You must select something.
    }
    elseif (%nospam == $null) {
      if (%a == a) {
        if (%o == $null) && (%v == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,ov)) {
            .timer 1 %HUGZtimer /describe %chan %HugSlap $nick(%chan,%HUGZ,a,ov)
            inc %HUGZ 1
            inc %HUGZtimer 2
          }
        }
        elseif (%o == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,o)) {
            .timer 1 %HUGZtimer /describe %chan %HugSlap $nick(%chan,%HUGZ,a,o)
            inc %HUGZ 1
            inc %HUGZtimer 2
          }
        }
        elseif (%v == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,v)) {
            .timer 1 %HUGZtimer /describe %chan %HugSlap $nick(%chan,%HUGZ,a,v)
            inc %HUGZ 1
            inc %HUGZtimer 2
          }
        }
        else {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a)) {
            .timer 1 %HUGZtimer /describe %chan %HugSlap $nick(%chan,%HUGZ,a)
            inc %HUGZ 1
            inc %HUGZtimer 2
          }
        }
      }
      elseif (%o == o) || (%v == v) {
        var %HUGZ 1
        while (%HUGZ <= $nick(%chan,0,%o $+ %v)) {
          .timer 1 %HUGZtimer /describe %chan %HugSlap $nick(%chan,%HUGZ,%o $+ %v)
          inc %HUGZ 1
          inc %HUGZtimer 2
        }
      }
      else {
        var %selected $did(HUGZ,6,0).sel
        var %sel 1
        while (%sel <= %selected) {
          .timer 1 %HUGZtimer /describe %chan %HugSlap $did(HUGZ,6,$did(HUGZ,6,%sel).sel).text
          inc %sel 1
          inc %HUGZtimer 2
        }
      }
    }
    else {
      if (%a == a) {
        if (%o == $null) && (%v == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,ov)) {
            set %HugzNicks $addtok(%HugzNicks,· $+ $nick(%chan,%HUGZ,a,ov) $+ ·,32)
            inc %HUGZ 1
          }
          if ($nick(%chan,%HUGZ,a,ov) ison %chan) {
            describe %chan %HugSlap %HugzNicks
            unset %HugzNicks
          }
        }
        elseif (%o == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,o)) {
            set %HugzNicks $addtok(%HugzNicks,· $+ $nick(%chan,%HUGZ,a,o) $+ ·,32)
            inc %HUGZ 1
          }
          if ($nick(%chan,%HUGZ,a,o) ison %chan) {
            describe %chan %HugSlap %HugzNicks
            unset %HugzNicks 
          }         
        }
        elseif (%v == $null) {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a,v)) {
            set %HugzNicks $addtok(%HugzNicks,· $+ $nick(%chan,%HUGZ,a,v) $+ ·,32)
            inc %HUGZ 1
          }
          if ($nick(%chan,%HUGZ,a,v) !ison %chan) {
            describe %chan %HugSlap %HugzNicks
            unset %HugzNicks
          }
        }
        else {
          var %HUGZ 1
          while (%HUGZ <= $nick(%chan,0,a)) {
            set %HugzNicks $addtok(%HugzNicks,· $+ $nick(%chan,%HUGZ,a) $+ ·,32)
            inc %HUGZ 1
          }
          if ($nick(%chan,%HUGZ,a) !ison %chan) {
            describe %chan %HugSlap %HugzNicks
            unset %HugzNicks
          }
        }
      }
      elseif (%o == o) || (%v == v) {
        var %HUGZ 1
        while (%HUGZ <= $nick(%chan,0,%o $+ %v)) {
          set %HugzNicks $addtok(%HugzNicks,· $+ $nick(%chan,%HUGZ,%o $+ %v) $+ ·,32)
          inc %HUGZ 1
        }
        if ($nick(%chan,%HUGZ,%o $+ %v) ison %chan) {
          describe %chan %HugSlap %HugzNicks
          unset %HugzNicks
        }
      }
      else {
        var %selected $did(HUGZ,6,0).sel
        var %sel 1
        while (%sel <= %selected) {
          set %HugzNicks $addtok(%HugzNicks,· $+ $did(HUGZ,6,$did(HUGZ,6,%sel).sel).text $+ ·,32)
          inc %sel 1
        }
        describe %chan %HugSlap %HugzNicks
        :Hugznull
        unset %HugzNicks
      }
    }
  }
  if ($devent == sclick) && ($did == 13) {
    did -r HUGZ 6
    set %chan [ $active ]
    did -ra HUGZ 8 %chan
    var %HUGZz 1
    while (%HUGZz <= $nick(%chan,0)) {
      didtok HUGZ 6 32 $nick(%chan,%HUGZz)
      inc %HUGZz
    }
  }
  if ($devent == sclick) {
    if ($did == 10) {
      did -u HUGZ 11
      did -c HUGZ 10
    }
    if ($did == 11) {
      did -u HUGZ 10
      did -c HUGZ 11
    }
  }
}

Comments

Sign in to comment.
Kirby   -  Oct 27, 2008

Ooh, didn't notice the tokens. :p
That's a new thing.

 Respond  
Kirby   -  Oct 27, 2008

Not necessarily 'Useful' since it's a bit spammy, but I like the idea.
I concur with ^Neptune - /me rates 7. :p
Good job on implementing the previous HUGZ script using normal aliases.

 Respond  
Blitzjager   -  Oct 27, 2008

Thanks. ^^
I think they're fixed now.
/me goes back to school

 Respond  
^Neptune   -  Oct 27, 2008

Works well for your first dialog! It's not exactly useful, so I gave it a 6 for "Neat". Would be good to fix the bugs though.

 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.