|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
I've been working on this script for a couple of weeks, and for the most part it works, but something has gone wrong with the alias (which follows). I'm only posting the alias, since the rest of the code works perfectly. If anyone can figure out what's wrong with the alias, I'll be happy to include your name in the credits section of the script. Additionally, if anyone can suggest a better way of doing the alias, I'm all ears (or eyes, I suppose would be more accurate). There's no display when I run the script. I'm hoping that it's either something simple and I'm overlooking it from having concentrated on the script for so long, or that it's something fairly major that I've missed because I didn't think of it. on *:dialog:slap_manager:sclick:5:{
slap $did(6).state $did(7).state $did(8).state $did(11).state $did(12).state $did(13).state
}
alias slap {
if $1-3 == 1 0 0 {
var %a = 1, %b = $scon(0)
while %a <= %b {
.scon %a
var %c = 1, %d = $chan(0)
while %c <= %d {
var %e = 1, %f = $nick($chan(%c),0)
while %e <= %f && $nick($chan(%c),%e) != $me {
var %g = 1, %h = $iif($4-5 == 0 1,$did(slap_manager,3,0).csel,$did(slap_manager,3).lines)
while %g <= %h {
var %slap = $iif($4-6 == 1 0 1,$did(slap_manager,3,$r(1,$did(slap_manager,3).lines)),$iif($4-6 == 1 0 0,$did(slap_manager,3,%g),$iif($4-6 == 0 1 0,$did(slap_manager,3,$did(slap_manager,3,%g).csel),$did(slap_manager,3,$r(1,$did(slap_manager,3,0).csel)))))
.timer 1 %g describe $chan(%c) slaps $nick($chan(%c),%e) %slap
inc %g
}
inc %e
}
inc %c
}
.scon -r
inc %a
}
}
elseif $1-3 == 1 0 1 {
var %a = 1, %b = $scon(0)
while %a <= %b {
var %network = $r(1,$scon(0))
.scon %network
var %c = 1, %d = $chan(0)
while %c <= %d {
var %chan = $r(1,$chan(0))
var %e = 1, %f = $nick(%chan,0)
while %e <= %f {
var %nick = $r(1,$nick(%chan,0))
if $nick(%chan,%nick) != $me {
var %g = 1, %h = $iif($4-5 == 0 1,$did(slap_manager,3,0).csel,$did(slap_manager,3).lines)
while %g <= %h {
var %slap = $iif($4-6 == 1 0 1,$did(slap_manager,3,$r(1,$did(slap_manager,3).lines)),$iif($4-6 == 1 0 0,$did(slap_manager,3,%g),$iif($4-6 == 0 1 0,$did(slap_manager,3,$did(slap_manager,3,%g).csel),$did(slap_manager,3,$r(1,$did(slap_manager,3,0).csel)))))
.timer 1 %g describe $chan(%c) slaps $nick(%chan,%e) %slap
inc %g
}
}
inc %e
}
inc %c
}
.scon -r
inc %a
}
}
elseif $1-3 == 0 1 0 {
var %a = 1, %b = $scon(0)
while %a <= %b && $xdid(slap_manager,1,%a).state == 2 {
.scon %a
var %c = 1, %d = $chan(0)
while %c <= %d && $xdid(slap_manager,1,%a %c).state == 2 {
var %e = 1, %f = $nick($chan(%c),0)
while %e <= %f && $xdid(slap_manager,1,%a %c %e).state == 2 {
while %g <= %h {
var %slap = $iif($4-6 == 1 0 1,$did(slap_manager,3,$r(1,$did(slap_manager,3).lines)),$iif($4-6 == 1 0 0,$did(slap_manager,3,%g),$iif($4-6 == 0 1 0,$did(slap_manager,3,$did(slap_manager,3,%g).csel),$did(slap_manager,3,$r(1,$did(slap_manager,3,0).csel)))))
.timer 1 %g describe $chan(%c) slaps $nick(%chan,%e) %slap
inc %g
}
inc %e
}
inc %c
}
.scon -r
inc %a
}
}
elseif $1-3 == 0 1 1 {
var %a = 1, %b = $scon(0)
while %a <= %b {
var %network = $r(1,$scon(0))
if $xdid(slap_manager,1,%network).state == 2 {
.scon %a
var %c = 1, %d = $chan(0)
while %c <= %d {
var %chan = $r(1, $chan(0))
if $xdid(slap_manager,1,%network %chan).state == 2 {
var %e = 1, %f = $nick(%chan,0)
while %e <= %f {
var %nick = $r(1,$nick(%chan,0))
if $xdid(slap_manager,1,%network %chan %nick).state == 2 {
while %g <= %h {
var %slap = $iif($4-6 == 1 0 1,$did(slap_manager,3,$r(1,$did(slap_manager,3).lines)),$iif($4-6 == 1 0 0,$did(slap_manager,3,%g),$iif($4-6 == 0 1 0,$did(slap_manager,3,$did(slap_manager,3,%g).csel),$did(slap_manager,3,$r(1,$did(slap_manager,3,0).csel)))))
.timer 1 %g describe %chan slaps %nick %slap
inc %g
}
}
inc %e
}
}
inc %c
}
}
.scon -r
inc %a
}
}
else {
echo 4 -a ERROR $1-
halt
}
}
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Russell I seen a few post of this.. im getting formiliar with it. What do you mean by no display?
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Just exacly what I said. Nothing shows in the channel in a format similar to that of RusselB slaps Lpfix5 with 1..2..tree
P.S.: You can't be getting familiar with this specific script, as this is the first time I've posted regarding it.
Last edited by RusselB; 10/10/06 02:35 AM.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Im a little confused in the script becaue of the while loops in while loops
Im gonna look at it a bit but for starts though your using a var called %g and you have it increment while timers 1 %g is present meaning its gonna open a timer all the way through till its done in the script and keep incrementing the %g var so a new timer is created
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
The %g variable, for lack of a better expression, tracks which slap in the list will be used for the slap. The usage of the %g variable in the timer simply prevents most flood protections from activating, as it limits the display to one slap per second.
First slap at 1 second Second at 2 seconds Third at 3 seconds etc.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Ok I tested a bit started with the if $1-3 == 1 0 0 code I changed a few scenarios your var for %slaps is controlled by your dialog which is fine so I put word slapsslaps instead to test
now for the part that is controlled with %g in the while loop now just for example
if the %h becomes $null or inproper it returns nothing(no display)
so I did a small test I put %h = 1 and change the $null back to %h I get
1 describe #Chat slaps FreedomRules SlapsSlaps 1 describe #Chat slaps geemy SlapsSlaps 1 describe #Chat slaps HttpStats SlapsSlaps 1 describe #Chat slaps Phatt_One SlapsSlaps 1 describe #Chat slaps Rikuume SlapsSlaps 1 describe #Chat slaps RuBy SlapsSlaps 1 describe #Chat slaps snow[a] SlapsSlaps 1 describe #Chat slaps alucard SlapsSlaps 1 describe #Chat slaps dac SlapsSlaps 1 describe #Chat slaps dgram SlapsSlaps 1 describe #Chat slaps Doc SlapsSlaps 1 describe #Chat slaps Elder SlapsSlaps
this is just for my test to echo the result...
below I posted a $null version to show you that nothing happens so im thinking whatever is written to your %h var is what you need to worry about. so you see if anything does not fucntion properly in the echo for your vars your stuck in lala land.
[code]alias slap { if $1-3 == 1 0 0 { var %a = 1, %b = $scon(0) while %a <= %b { .scon %a var %c = 1, %d = $chan(0) while %c <= %d { var %e = 1, %f = $nick($chan(%c),0) while %e <= %f && $nick($chan(%c),%e) != $me { var %g = 1, %h = 4 while %g <= $null { var %slap = SlapsSlaps echo -a %g describe $chan(%c) slaps $nick($chan(%c),%e) %slap inc %g } inc %e } inc %c } .scon -r inc %a } } }
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Thanks for your help. Problem has been located, now I need to figure out a solution. If I haven't figured out something by the end of the week, I'll post for further assistance.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
In my tests, I'd used a checked sequence, which corresponds to passing the alias 0 1 0 0 1 0 This meant that the script was checking if the item in ID 1 was checked. Since ID 1 is a treeview listing, there are actually 3 levels that can be checked (network, channel, & nick). I was checking the nick level, but the script was looking for a check at the network level first, then the channel level, then (finally) the nick level, and since it wasn't checking for the nick level if the channel level wasn't checked (and likewise with the network & channel levels), the script kept jumping through.
I hope you can make sense of that explanation..obviously it wouldn't occur in all circumstances, but since I didn't want to send a lot of slaps to a lot of channels, I wasn't testing all of the options available.
|
|
|
|
Joined: Aug 2005
Posts: 1,052
Hoopy frood
|
Hoopy frood
Joined: Aug 2005
Posts: 1,052 |
Yeah I understand, cool that you figured it out I would however make on alias with all the while loops in place and have like
%g = $1 and %a = $2 so you just have to fill those parameters in on a alias call rather then making the while loops all the time but its upon pure reference but im sure you written something in the past that you got lost in your own written script
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
OP
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
Here's a simpler explanation while %a <= %b && $xdid(slap_manager,1,%a).state == 2 { .scon %a var %c = 1, %d = $chan(0) while %c <= %d && $xdid(slap_manager,1,%a %c).state == 2 { var %e = 1, %f = $nick($chan(%c),0) while %e <= %f && $xdid(slap_manager,1,%a %c %e).state == 2
Red which would've corresponded to a match, wouldn't have been reached, since neither Green nor Blue had corresponding matches (checked boxes)
|
|
|
|
|