|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
if (%var == 1) { echo -a do this } else echo -a do that
the %var is set to 1 .. then u halted ur script.. but if set to 2, then it shouldent halt..
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
oh okay... Thanks So now my script looks like this:
on *:TEXT:!request*:#channel:{
if ($2 == $me) && ($left($3,1) == $chr(35)) {
join $3
set $+(%,req,$3) $nick
}
}
on me:*:INPUT:#:{
if ($1 == /j) || ($1 == /join) || ($1 == /hop) {
set %var 1
}
elseif ($1 == /part) {
set %var 2
}
}
*raw 366:*:{
if (%var == 1) || %var == 2) { goto end }
elseif ($nick !isop $2) {
.timer 1 3 part $2
.timer 1 5 msg $eval($+(%,req,$2),2) You are not opped on channel $2 try again when you have op.
}
elseif ($nick($2,0) < 5) {
.timer 1 3 .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
.timer 1 5 .part $2
}
else timer 1 3 .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
unset $+(%,req,$2)
:end
}
Is there anyone there can spot errors?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
why dont u just try it? then u notice if its any problem
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
raw 366:*:{
if (%var == 1) || %var == 2) { goto end }
[color:red]elseif ($nick !isop $2) {
.timer 1 3 part $2
.timer 1 5 msg $eval($+(%,req,$2),2) You are not opped on channel $2 try again when you have op.
}
elseif ($nick($2,0) < 5) {
.timer 1 3 .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
.timer 1 5 .part $2
}
else timer 1 3 .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
unset $+(%,req,$2)
:end
}[/color]
Text marked with red doesnt work.
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
There is no $nick in raw events.
New username: hixxy
|
|
|
|
Joined: Mar 2004
Posts: 457
Fjord artisan
|
Fjord artisan
Joined: Mar 2004
Posts: 457 |
why not instead of messing around with the RAW, just do a 5 second timer on join to call an alias which uses $nick(#channelname,0)
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
because a] the raw evenm works fine as it was. It does as he asked. He'll just need to modify it a bit, like in the raw event, check if the variable $+(%,req,$2) exists before doing anything else. that should take care of both the /hop and the /join problem b] timers are notoriously unreliable in all matters that deal with joining channels, services of any kind of automated system that could be lagged, but whose response is absolutely necessary for the script. In such cases, in good scripting, one never uses a timer, but always an event triggered by the response.
on *:TEXT:!request*:#channelname: {
if ($2 == $me) && ($left($3,1) == $chr(35)) { join $3 | set $+(%,req,$3) $nick }
}
[color:blue] [/color]
raw 366:*: {
[color:blue]if ($+(!%,req,$2)) halt[/color]
[color:red]if ($eval($+(%,req,$2),2) !isop $2) {
.msg $eval($+(%,req,$2),2) Request failed. You are not opped on channel $2 try again when you have op.
.part $2
}[/color]
elseif ($nick($2,0) < 5) {
.msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
.part $2
}
else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
unset $+(%,req,$2)
}
The blue line is added to my original code to prevent the raw event from triggering if you do a /hop or manual /join or any other kind of join that was not triggered by the script. This could still malfunction if you do a join or hop while the script is processing the !request command by a user, but odds of that happening are kinda astronomical. The part in red is added to check if the requester is an op in the channel.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
LocutusofBorg i am using your script. But the:
if ($eval($+(%,req,$2),2) !isop $2) {
.msg $eval($+(%,req,$2),2) Request failed. You are not opped on $2 try again when you have op.
.part $2
}
elseif ($nick($2,0) < 5) {
.msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
.part $2
}
else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
unset $+(%,req,$2)
}
That part still seams like it wont trigger
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
I tested it before posting - it works fine. Just remember YOU cannot trigger it. Try this tho:
on *:TEXT:!request*:#channelname: {
if ($2 == $me) && ($left($3,1) == $chr(35)) { join $3 | set $+(%,req,$3) $nick }
}
[color:red] [/color]
raw 366:*: {
if ($+(%,req,$2)) {
if ($eval($+(%,req,$2),2) !isop $2) {
.msg $eval($+(%,req,$2),2) Request failed. You are not opped on channel $2 try again when you have op.
.part $2
}
elseif ($nick($2,0) < 5) {
.msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
.part $2
}
else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
unset $+(%,req,$2)
}
}
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Okay. Thats wierd ![crazy crazy](/images/graemlins/mirc/crazy.gif) i got 2 mirc installed. I go to a channel with one of them where im opped but only one user. Then i use !request <botname> #channel and then it joins but doenst part.
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Okay now it works. But now we have the old /hop /join /j problem back.
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2003
Posts: 3,432
Hoopy frood
|
Hoopy frood
Joined: Feb 2003
Posts: 3,432 |
if ($1 == /hop) %% (%var == 2) { set %var 1 }
if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
|
|
|
|
Joined: Mar 2003
Posts: 1,271
Hoopy frood
|
Hoopy frood
Joined: Mar 2003
Posts: 1,271 |
Have someone triger the script. See if the variable still exists after awhile. it shouldn't.
DALnet #Helpdesk I hear and I forget. I see and I remember. I do and I understand. -Confucius
|
|
|
|
|