mIRC Home    About    Download    Register    News    Help

Print Thread
#131434 29/09/05 07:38 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
Hi

i am trying to make something for my bot when i notice him with the text .say ... and then he should do/say the ...

script:

Code:
}
on *:notice:#gameaddict: {

  if ($1 == botsay) {
  amsg $2 } else { HALT } 
}




and then something else... i want something when my bot gets kicked he rejoins and kicks the one who kicked him but it keeps rejoining

[code]
on *:kick:#: {

if ($address($nick,1) != %bot) && ($address($nick,1) != %sc) {

set %badnick $nick

join #gameaddict

.timer 1 2 kick $chan %badnick

}
}
[/code

%bot and %sc are addresses i put in vars...


i hope someone can help me solve this ...
]

#131435 29/09/05 08:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Your notice line has a bad format to it. Also, you really should think about formatting your script rather than trying to put things on the same lines like that. Without using a |, it won't work. You also don't need to halt anything when you're at the end of a script.

Code:
on *:notice:*:#gameaddict: {
  if ($1 == botsay) {
    amsg $2
  }
}



Code:
on *:kick:#: {
  if ($address($nick,1) != %bot) && ($address($nick,1) != %sc && $knick == $me) { 
    set %badnick $nick
    join #gameaddict
    .timer 1 2 kick $chan %badnick 
  }
}


Invision Support
#Invision on irc.irchighway.net
#131436 29/09/05 08:17 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
The kick thingy works but the notice thing doesnt

i don't know why :s

i type this in a window /notice g4mebot botsay test

and he doesnt say anything...

#131437 29/09/05 08:25 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Check for any errors on the bot. Also, I just looked more closely at your notice script... change it to amsg $2- instead of amsg $2. Also, try replacing the channel name with * or ?.


Invision Support
#Invision on irc.irchighway.net
#131438 29/09/05 08:28 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
thx dude, ... it works fine now, the problem was the chan name it needed to be * like u said laugh u are one PRO irc scripter ;-)

#131439 29/09/05 08:38 PM
Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
By specifying # or a channel named in the location field you are telling mirc you want the event to trigger on a channel notice, not a private notice as a question mark would indicate. It would probably be a good idea to use ? instead of *, * will respond to both private and channel wide notices.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
#131440 30/09/05 03:50 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
Now i made something to make my bot do stuff for me but it doesn't work 8-)

Code:
on *:notice:*:?: {
  if ($address($nick,1) == %sc) {
    if ($1 == .) { 
      if ($2 == kk) {amsg debug! | kick #
      if ($2 == vc) {echo :: Bot Voice :: | %mde +v $3
      if ($2 == dvc) {echo :: Bot DeVoice :: | %mde -v $3
      if ($2 == bn) {echo :: Bot KickBan :: | kick $chan $3 $4 | %mde +b $3
      if ($2 == ubn) {echo :: Bot Unban :: | %mde -b $3
      if ($2 == blist) {echo :: Bot Banlist :: | %mde -b
      ; if ($2 == say) {echo :: Bot Say :: | amsg Controlled by: $nick | amsg $3
    }
  }
}

#131441 30/09/05 04:36 PM
Joined: Sep 2005
Posts: 116
I
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
remove those { after the if's also u might use a elsif

[code]on *:notice:*:?: {
if ($address($nick,1) == %sc) {
if ($1 == .) {
if ($2 == kk) amsg debug! | kick #
elseif ($2 == vc) echo :: Bot Voice :: | %mde +v $3
elseif ($2 == dvc) echo :: Bot DeVoice :: | %mde -v $3
elseif ($2 == bn) echo :: Bot KickBan :: | kick $chan $3 $4 | %mde +b $3
elseif ($2 == ubn) echo :: Bot Unban :: | %mde -b $3
elseif ($2 == blist) echo :: Bot Banlist :: | %mde -b
; elseif ($2 == say) echo :: Bot Say :: | amsg Controlled by: $nick | amsg $3
}
}
}

#131442 30/09/05 04:45 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
doesnt work frown

#131443 30/09/05 05:10 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can't remove the {}'s because |'s are used which takes it out of the IF section.

Use {}'s around the IF sections, but make sure that you have one at the beginning AND the end of each section. Also, make sure you have spaces around the {}'s... {amsg won't work, but { amsg will.


Invision Support
#Invision on irc.irchighway.net
#131444 30/09/05 07:07 PM
Joined: Sep 2005
Posts: 21
S
SalCro Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Sep 2005
Posts: 21
i'm sorry but, it still doesn't work

i have this now:

Code:
on *:notice:*:?: {  
  if ($address($nick,1) == %sc) {    
    if ($1 == .) {      
      if ($2 == kk) { amsg debug! | kick # $3 }
      elseif ($2 == vc) { echo :: Bot Voice :: | %mde +v $3 }
      elseif ($2 == dvc) { echo :: Bot DeVoice :: | %mde -v $3 }
      elseif ($2 == bn) { echo :: Bot KickBan :: | kick $chan $3 $4 | %mde +b $3 }
      elseif ($2 == ubn) { echo :: Bot Unban :: | %mde -b $3 }
      elseif ($2 == blist) { echo :: Bot Banlist :: | %mde -b }
      elseif ($2 == say) { echo :: Bot Say :: | amsg Controlled by: $nick | amsg $3 }
    }
  }
}

#131445 30/09/05 07:44 PM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
Try this

on *:NOTICE:.*:?: {
if ($address($nick,1) == %sc) {
var %com = $right($1,-1)
if (%com == kk) { amsg debug! | kick # $3 }
elseif (%com == vc) { echo :: Bot Voice :: | %mde +v $3 }
elseif (%com == dvc) { echo :: Bot DeVoice :: | %mde -v $3 }
elseif (%com == bn) { echo :: Bot KickBan :: | kick $chan $3 $4 | %mde +b $3 }
elseif (%com == ubn) { echo :: Bot Unban :: | %mde -b $3 }
elseif (%com == blist) { echo :: Bot Banlist :: | %mde -b }
elseif (%com == say) { echo :: Bot Say :: | amsg Controlled by: $nick | amsg $3 }
}
}

Last edited by mIRCManiac; 30/09/05 07:46 PM.
#131446 30/09/05 07:48 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Um... What are you trying to type?

.vc

or
. vc
(ie. with a space)?

$1 is only = . if you don't have it connected to "vc". If you're using .vc, then $1 = .vc.

Since I think you mean to use .vc and such, delete the If $1 == . part (and the } at the end of that section), keeping the if $2 == ___ parts. Then, change the $2's to $1's and the $3's to $2's.

I wasn't going to write it all out, but here it is anyhow...
Code:
on *:notice:*:?: { 
  if ($address($nick,1) == %sc) { 
  if ($left($1,1) == .) {
    if ($1 == .kk) { amsg debug! | kick # $2 $3- }
    elseif ($1 == .vc) { echo :: Bot Voice :: | %mde +v $2 }
    elseif ($1 == .dvc) { echo :: Bot DeVoice :: | %mde -v $2 }
    elseif ($1 == .bn) { echo :: Bot KickBan :: | kick $chan $2 $3- | %mde +b $2 }
    elseif ($1 == .ubn) { echo :: Bot Unban :: | %mde -b $2 }
    elseif ($1 == .blist) { echo :: Bot Banlist :: | %mde -b }
    elseif ($1 == .say) { echo :: Bot Say :: | amsg Controlled by: $nick | amsg $2- }
  }
}


I added the $left section to prevent all these ifs from being checked if the notice doesn't start with "." That should make it a bit faster. You can make it even faster yet (i.e. less lines to check), if you move the commands that you are planning to use most often to the top. So, if you use .say more than anything else, that should be the first check.

Now, remember that # and $chan will not be filled on a private notice. You need to specify the channels in some manner for those parts to work.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard