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