|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
Hi all! I've started making bots a few dayes ago...well i'm only starting. I won't give all my history here, so buttom line is there are some things i don't know how to do: 1) How can i give only ops the ability to give a bot a specific command and write an error message else. that's what i have 4 now: remote window:
on 1:text:autowelcome on:?:{ .enable #welcome | /msg $nick The auto-welcome is now switched ON }
on 1:text:autowelcome off:?:{ .disable #welcome | /msg $nick The auto-welcome is now switched OFF }
#welcome on
on 1:JOIN:#channel-x:/msg $nick Welcome $nick ! Thx for coming to #channel-x channel! Plz stay, enjoy and perform!
#welcome end
popup window: Turn welcome message on: {.enable #welcome}
Turn welcome message off: {.disable #welcome} 2) How can i give an op the option to edit the bot's message? for example, i have this: on 1:TEXT:!news:#channel-x:/msg $chan bla bla and i want the admin to be able to edit it. 3) Not a bot question. How can I make me write an auto-message when someone gives me an op/voice. Thanking you all very much in anticipation! ***edit*** and i forgot a 4th one ![smirk smirk](/images/graemlins/mirc/smirk.gif) 4) How can I make the protection that if another op deops/kicks/bans me in a channel that i'm oped in he gets an auto ban+kick before? ***last edit*** As you see I'm kind of a newb. If you can give me some good and advanced, yet easy to understand, tutorials it will be really great. 10x again!
Last edited by x3RiouS; 06/05/04 07:13 PM.
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
/help on text /help isop /help on kick /help on voice there are also good tutorials here for many scripting problems, most by members of this board. ;o) hope this helps
billythekid
|
|
|
|
Joined: Dec 2002
Posts: 1,237
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,237 |
In addition to billythekid's post, you also may want to also type this in mIRC: /help User List to learn about how certain users can access certain commands....just a thought.
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
10q both very much! Well...I still don't understand stuff ![smirk smirk](/images/graemlins/mirc/smirk.gif) I wrote the following in the remote: ON *:text:flood_protect on:?: { if($nick isop $chan) { .enable #flood_protect | .msg $nick Text flood protection is now ON } ELSE { /msg $nick You do not have access to this command} }
ON *:text:flood_protect off:?:{ if($nick isop $chan) { .disable #flood_protect | .msg $nick Text flood protection is now OFF } ELSE { /msg $nick You do not have access to this command} }
#flood_protect on
ON @1:TEXT:*:#:{ .auser 200 $nick | /timer2 1 3 .ruser $nick }
ON @+200:TEXT:*:#:{ .timer2 off | .auser 201 $nick | .timer3 1 3 .ruser 200 $nick }
ON @+201:TEXT:*:#:{ .timer3 off | /auser 202 $nick | /timer4 1 3 /ruser 201 $nick }
ON @+202:TEXT:*:#:{ .timer4 off | .ruser $nick | .kick $chan $nick Text Flood Detected! }
#flood_protect end and this in the popup: Turn flood_protect on:{ .enable #flood_protect }
Turn flood_protect off:{ .disable #flood_protect }
And it isn't working. What is the problem?! And I still don't know how to give ops the ability to edit a bot's message (as i wrote in the first post). 10x again!
Last edited by x3RiouS; 07/05/04 08:46 PM.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
You are missing some spaces there
ON *:text:flood_protect on:?: { if ($nick isop $chan) { .enable #flood_protect | .msg $nick Text flood protection is now ON } ELSE { /msg $nick You do not have access to this command } }
ON *:text:flood_protect off:?: { if ($nick isop $chan) { .disable #flood_protect | .msg $nick Text flood protection is now OFF } ELSE { /msg $nick You do not have access to this command } }
#flood_protect on
ON @1:TEXT:*:#: { .auser 200 $nick | /timer2 1 3 .ruser $nick }
ON @+200:TEXT:*:#: { .timer2 off | .auser 201 $nick | .timer3 1 3 .ruser 200 $nick }
ON @+201:TEXT:*:#: { .timer3 off | /auser 202 $nick | /timer4 1 3 /ruser 201 $nick }
ON @+202:TEXT:*:#: { .timer4 off | .ruser $nick | .kick $chan $nick Text Flood Detected! }
#flood_protect end Hope it helps
Last edited by Zyzzyx26; 07/05/04 08:59 PM.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
Still it doesn't seem to work like it should
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
ON *:text:flood_protect on:?: {
if ($nick isop $chan) {
.enable #flood_protect
.msg $nick Text flood protection is now ON
}
else msg $nick You do not have access to this command
}
ON *:text:flood_protect off:?: {
if ($nick isop $chan) {
.disable #flood_protect
.msg $nick Text flood protection is now OFF
}
else msg $nick You do not have access to this command
} Try like this, maybe its the order ![smirk smirk](/images/graemlins/mirc/smirk.gif) Here, however, is the problem. You cant have all those on TEXT in the same remote.. try this:
#flood_protect on
ON @*:TEXT:*:#: {
if ($ulevel == 1) {
.auser 200 $nick
timer2 1 3 .ruser $nick
}
elseif ($ulevel == 200) {
.timer2 off
.auser 201 $nick
.timer3 1 3 .ruser 200 $nick
}
elseif ($ulevel == 201) {
.timer3 off
auser 202 $nick
timer4 1 3 /ruser 201 $nick
}
elseif ($ulevel == 202) {
.timer4 off
.ruser $nick
.kick $chan $nick Text Flood Detected!
}
}
#flood_protect end Im not trying to correct your way of scripting by not using the | but it looks cleaner to me, to check for errors and stuff. $ulevel is the level of the user who activated the command. Hope it helps
Last edited by Zyzzyx26; 07/05/04 09:39 PM.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
ON *:text:flood_protect on:?: { if ($nick isop $chan) { .enable #flood_protect | .msg $nick Text flood protection is now ON } ELSE { /msg $nick You do not have access to this command } }
ON *:text:flood_protect off:?: { if ($nick isop $chan) { .disable #flood_protect | .msg $nick Text flood protection is now OFF } ELSE { /msg $nick You do not have access to this command } } You need to put pipes before ELSE like } | ELSE { or as you stated, use a newline, which in this case will improve readability and error checkign considerably. Greetz
Gone.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Interesting.. didnt know about the pipe thingie Thanks!
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You are also trying to check " if ($nick isop $chan)" where $chan is invalid. There is no $chan in a private message event. - if ($nick isop #channame)
Also your timernames are going to conflict. If you name timers you should try to use unique names. In this case '$site' would be good. ON @1:TEXT:*:#:.auser 200 [color:maroon]$wildsite[/color] | .timer [color:tomato]$+ $site[/color] 1 3 .ruser [color:maroon]$wildsite[/color]
ON @+200:TEXT:*:#:.auser 201 [color:maroon]$wildsite[/color] | .timer [color:tomato]$+ $site[/color] 1 3 .ruser [color:maroon]$wildsite[/color]
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
10x guys! You really helped me! Well...last thing- can you tell me how can i do the following: How can i give an op the ability to edit the bot's message? for example, i have this: on *:TEXT:!news:#channel-x:/msg $chan bla bla and i want the op to be able to edit the "bla bla" message. ?
Last edited by x3RiouS; 08/05/04 09:36 AM.
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
![smirk smirk](/images/graemlins/mirc/smirk.gif) it still isn't switching on and off. if i'm an op in a channel it gives me the "you do not have access" error. that's what i've wrote in the remote, as you said: ON *:text:flood_protect on:?: {
if ($nick isop #channame) {
.enable #flood_protect
.msg $nick Text flood protection is now ON
}
else msg $nick You do not have access to this command
}
ON *:text:flood_protect off:?: {
if ($nick isop #channame) {
.disable #flood_protect
.msg $nick Text flood protection is now OFF
}
else msg $nick You do not have access to this command
}
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Did you change #channame to the channels actual name?
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
![blush blush](/images/graemlins/mirc/blush.gif) yep! that was the problem! 10q very much! now it's 100% working! And last: How can i give an op the ability to edit the bot's message? for example, i have this: on *:TEXT:!news:#channel-x:/msg $chan bla bla and i want the op to be able to edit the "bla bla" message. ? 10q very much all!
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
You could put the news into a variable. on *:TEXT:!news:#channel-x:msg $chan News: $iif(%news. [ $+ [ $chan ] ],$ifmatch,None.) on *:text:!news *:#:{
if $nick isop # { set %news. $+ # $2- }
} Ops can use !news new news to set it into a variablelike this: %news.#channame new news
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
seems like every part works! ![laugh laugh](/images/graemlins/mirc/laugh.gif) 10x again! Well now there's another problem...I hope it's my final and last problem: This is the script on the remote:
;news
on *:text:!news *:#chan:{
if $nick isop #chan { set %news. $+ # $2- }
}
on *:TEXT:!news:#chan:/msg $chan $iif(%news. [ $+ [ $chan ] ],$ifmatch,None.)
;thats the news
;welcome
ON *:text:welcome on:?: {
if ($nick isop #chan) {
.enable #welcome
.msg $nick Welcome message is now ON
}
else msg $nick You do not have access to this command
}
ON *:text:welcome off:?: {
if ($nick isop #chan) {
.disable #welcome
.msg $nick Welcome message is now OFF
}
else msg $nick You do not have access to this command
}
#welcome on
on *:JOIN:#chan:/msg $nick Welcome $nick ! Thx for coming to #chan channel! Plz stay, enjoy and perform!
#welcome end
;thats the welcome
;adv protect
ON *:text:adv_protect on:?: {
if ($nick isop #chan) {
.enable #adv_protect
.msg $nick adv protection is now ON
}
else msg $nick You do not have access to this command
}
ON *:text:adv_protect off:?: {
if ($nick isop #chan) {
.disable #adv_protect
.msg $nick adv protection is now OFF
}
else msg $nick You do not have access to this command
}
#adv_protect on
ON @*:TEXT:*:#chan: {
if ($wildtok($strip($1-),#*,0,32) > 0) && ($nick !isop $chan) {
var %ch = $wildtok($strip($1-),#*,0,32)
while (%ch) {
if ($wildtok($strip($1-),#*,%ch,32) != $chan) { var %adv = 1 }
dec %ch
}
if (%adv) {
inc $+(%,adv.,$nick,.,$chan)
if ($($+(%,adv.,$nick,.,$chan),2) => 2) {
ban -ku3600 $chan $nick 3 I told you, don't advertise
unset $+(%,adv.,$nick,.,$chan)
}
else {
kick $chan $nick No advertising channels here
}
}
}
}
#adv_protect end
;thats the adv protect
;flood
ON *:text:flood_protect on:?: {
if ($nick isop #chan) {
.enable #flood_protect
.msg $nick Text flood protection is now ON
}
else msg $nick You do not have access to this command
}
ON *:text:flood_protect off:?: {
if ($nick isop #chan) {
.disable #flood_protect
.msg $nick Text flood protection is now OFF
}
else msg $nick You do not have access to this command
}
#flood_protect on
on @*:TEXT:*:#chan: {
IF ($nick !isop #chan) {
IF (%flood2. [ $+ [ $wildsite ] ] == $null) {
set -u5 %flood2. [ $+ [ $wildsite ] ] 1
}
ELSEIF (%flood2. [ $+ [ $wildsite ] ] >= 3) {
kick $chan $nick You flooded, you were kicked....that's the deal!
unset %flood2. [ $+ [ $wildsite ] ]
}
ELSE { inc -u5 %flood2. [ $+ [ $wildsite ] ] }
}
}
#flood_protect end
;thats the flood
The flood part isn't working. And it seems like if I switch between the location (In the remote page) of the flood and adv protection the adv is the one which isn't working.
|
|
|
|
Joined: Aug 2003
Posts: 1,831
Hoopy frood
|
Hoopy frood
Joined: Aug 2003
Posts: 1,831 |
Yep because they're both trying to match *any* text in the channel. mIRC will only trigger on the first matching event in any file. [*]Change the flood prot script to use: ON @[color:orangered]^*:TEXT:*:#chan: {[/color] (see /help halting default text for info on the ^ prefix) OR[*] combine them[*] place one, or both, in a seperate script file.
|
|
|
|
Joined: May 2004
Posts: 23
Ameglian cow
|
OP
Ameglian cow
Joined: May 2004
Posts: 23 |
That's it! everything works! Thank you very much!!! You really helped! Now It's learning time.... 10x again!
|
|
|
|
|