This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Idea: Voice and op counter

Old posts that have not been replied to for several years.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Idea: Voice and op counter

Post by Kaarel »

I made a script for miRC

Code: Select all

on 1:voice:#:{ 
if ($nick == $me) { inc %voices } 
else { halt } 
} 

menu channel { 
voice 
.yourself:/echo You have been given voices %voices times! 
.public:/msg $chan I have given voices %voices times! 
} 
But I would like to know can anybody make that kind of script to bot, I would be nice if in there script will be a kick and ban counter too
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

set vcount 0

bind mode - "* +v" my:voice

proc my:voice {nick uhost handle channel mode victim} {
  global vcount
  if {$nick != $::botnick} {
    return
  }
  incr vcount
  putserv "PRIVMSG $channel :I have voiced $vcount users!"
}
Once the game is over, the king and the pawn go back in the same box.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

by what trigger I get the number of voices bot has gives


also my bot respond <Botman> [15:06] Tcl error [my:voice]: invalid command name "? " on !vcount
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Add this code:

Code: Select all

bind pub o !vcount list:vcount

proc list:vcount {nick host handle channel text} {
  putserv "PRIVMSG $channel :I have voiced $::vcount users!"
}
and remove the:

Code: Select all

putserv "PRIVMSG $channel :I have voiced $vcount users!"
from the first one.
Once the game is over, the king and the pawn go back in the same box.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

Is that te right code

Code: Select all

set vcount 0 

bind mode - "* +v" my:voice 

proc my:voice {nick uhost handle channel mode victim} { 
  global vcount 
  if {$nick != $::botnick} { 
    return 
  } 
  incr vcount 

bind pub o !vcount list:vcount 

proc list:vcount {nick host handle channel text} { 
  putserv "PRIVMSG $channel :I have voiced $::vcount users!" 
} 

putserv "PRIVMSG $channel :I have voiced $vcount users!" 
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

remove this at the end:

Code: Select all

putserv "PRIVMSG $channel :I have voiced $vcount users!"


and if you want the bot to display anything about this script when you rehash, add this at the end of the file:

Code: Select all

putlog "Voice counter loaded.."
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

and also I noticed that you have mixed the codes...
remove these from the my:voice proc:

Code: Select all

bind pub o !vcount list:vcount 

proc list:vcount {nick host handle channel text} { 
  putserv "PRIVMSG $channel :I have voiced $::vcount users!" 
and add them after the my:voice proc.

the code should like this:

Code: Select all

set vcount 0 

bind mode - "* +v" my:voice
bind pub o !vcount list:vcount

proc my:voice {nick uhost handle channel mode victim} { 
  global vcount 
  if {$nick != $::botnick} { 
    return 
  } 
  incr vcount 
} 

proc list:vcount {nick host handle channel text} { 
putserv "PRIVMSG $channel :I have voiced $::vcount users!"
return 1
}

putlog "Voice counter loaded.."
«A fantastic spaghetti is a spaghetti that does not exist»
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

Ok, everything work but when my bot voice somebdy I get this error <Botman> [18:57] Tcl error [my:voice]: invalid command name "? "


What that means :(
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

did you try the new code that I gave you?
«A fantastic spaghetti is a spaghetti that does not exist»
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

ReaLz wrote:did you try the new code that I gave you?

yes

<Botman> Gave voice to Kaarel on #kaarel
<Botman> [19:06] #kaarel: mode change '+v Kaarel' by Botman!~Kaarel@213-35-147-242-dsl.prn.estpak.ee
<Botman> [19:06] Tcl error [my:voice]: invalid command name "? "


:( What I have to do
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I don't see any "?" in the code. Humm.. Have you .rehash'ed it after doing the changes? Also, what version is it?
Once the game is over, the king and the pawn go back in the same box.
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

caesar wrote:I don't see any "?" in the code. Humm.. Have you .rehash'ed it after doing the changes? Also, what version is it?
Yes a rehashed and even restarted the bot

version is Windrop 1.6.13


Can anybody try the same code in his bot, please
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

it works fine here... maybe it's a prob that you use windrop (?)
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
MD87
Voice
Posts: 23
Joined: Sat Dec 14, 2002 9:04 am
Location: Leicester, UK
Contact:

Post by MD87 »

As a stab in the dark, your bot's name doesn't have [?] in it does it? (or anything similar) :D

// Edit - pah, should learn to read
<Botman> [19:06] #kaarel: mode change '+v Kaarel' by Botman!~Kaarel@213-35-147-242-dsl.prn.estpak.ee
K
Kaarel
Halfop
Posts: 91
Joined: Sat Apr 26, 2003 5:24 am

Post by Kaarel »

MD87 wrote:As a stab in the dark, your bot's name doesn't have [?] in it does it? (or anything similar) :D

// Edit - pah, should learn to read
<Botman> [19:06] #kaarel: mode change '+v Kaarel' by Botman!~Kaarel@213-35-147-242-dsl.prn.estpak.ee
No it does not have
Locked