|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Hi.. I was wonderring how to make a script on a bot that locks the topic eg. If i have users in my remote with $ulevel 11 and a user without level 11 chages topic then the bot will change it back to the old topic... How do i make a script like that??
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
on me:*:join:[color:red]#[/color]: set %topic. [ $+ [ $chan ] ] $chan(#).topic
on @*:topic:[color:red]#[/color]: {
if (%topic. [ $+ [ $chan ] ]) {
if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
else { set %topic. [ $+ [ $chan ] ] $1- }
}
} You first need to save the old topic, that's why the On Join is there. If a non-11 changes the topic, it sets the old one back. If a lvl 11does the change, then it resets the topic lock. You can change the # to the channel(s) you want. Hope this helps Zyzzyx.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Okay and will it save the new one when the $ulevel 11 changes it?
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Yes, the else { set %topic. [ $+ [ $chan ] ] $1- } should do it.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Dec 2002
Posts: 145
Vogon poet
|
Vogon poet
Joined: Dec 2002
Posts: 145 |
This will save the topic on join, save a topic from user level 11 and refuse a topic from users of other levels. If there is no valid topic, this will erase a non valid one. It clears the variable on part and quit. on me:*:join:#: set $+(%,topic_,$chan) $chan(#).topic
on @+11:topic:#: set $+(%,topic_,$chan) $chan(#).topic
on @!*:topic:#: {
if ($len($eval($+(%,topic_,$chan ),2)) == 0) {
echo $chan $chr(160)
echo 04 -t $chan *** NO VALID TOPIC SET
echo $chan $chr(160)
topic $chan $chr(160)
}
else topic $chan $eval($+(%,topic_,$chan ),2)
}
on *:part:#: unset $+(%,topic_,$chan)
on *:quit: unset %topic_*
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Okay... Thanks alot for your help both of you hope to see you on mirc sometime... BTW you forgot
on *:part:#:{
[color:red] if ($nick == $me) { [/color]
unset $+(%,topic_,$chan)
}
}
on *:quit:{
[color:red] if ($nick == $me) { [/color]
unset %topic_*
}
}
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 |
Oh one thing more... This part doenst work on me:*:join:#: set $+(%,topic_,$chan) $chan(#).topic It doenst save the topic thats on when it joins
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
raw 366:*: set $+(%,topic,.,$chan) $chan($2).topic
on @*:topic:#: {
if (%topic. [ $+ [ $chan ] ]) {
if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
else { set %topic. [ $+ [ $chan ] ] $1- }
}
} This should do it
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
I'm sorry Zyzzyx26 but i dont quite understad that
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
The raw 366 is the end of the /names command, which is performed everytime you join a channel. $2, in the case, is the channel name. I don't know why that on me:*: join did not work, but the raw one will (unless you've previously halted it). BTW, the correct raw line is: raw 366:*: set $+(%,topic,.,$2) $chan($2).topicZyzzyx
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
Great... Hmm you are damn good at this.. There is only one problem now... Your script keeps looping... If a user that is not level 11 changes topic the bot changes back and keeps doing it... It spams!
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
raw 366:*: set $+(%,topic,.,$2) $chan($2).topic
on @[color:Red]![/color]*:topic:#: {
if (%topic. [ $+ [ $chan ] ]) {
if ($ulevel != 11) { topic $chan %topic. [ $+ [ $chan ] ] }
else { set %topic. [ $+ [ $chan ] ] $1- }
}
} Sorry, my bad The red ! should take care of it. It doesn't activate the script if the one running the code has triggered it. Have fun Zyzzyx.
Last edited by Zyzzyx26; 25/09/04 03:16 PM.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 132
Vogon poet
|
OP
Vogon poet
Joined: May 2004
Posts: 132 |
okay thanks... I also fixed the other one: raw 366:*: set $+(%,topic,.,$2) $chan($2).topic
on @+11:topic:#:{
set $+(%,topic,.,$chan) $chan(#).topic
}
on @!*:topic:#: {
if ($len($eval($+(%,topic,.,$chan ),2)) == 0) {
echo $chan $chr(160)
echo 04 -t $chan *** NO VALID TOPIC SET
echo $chan $chr(160)
topic $chan $chr(160)
}
else topic $chan $eval($+(%,topic,.,$chan ),2)
}
on me:*:part:#:{
unset $+(%,topic,.,$chan)
}
on me:*:quit:{
unset %topic,.*
}
if ($me != geek) { $life is $false } else { $life is $true } NoPleX
|
|
|
|
|