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.

how would a variable to a voice script??

Old posts that have not been replied to for several years.
Locked
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

how would a variable to a voice script??

Post by grinch157 »

i need some help.

how would i be able to ad a variable into this script.

Code: Select all

bind pubm - "*Sends:[0/1]*" voice_me
bind pubm - "*FTP Online*" voice_me
bind pubm - "*Sends:«1/1»*" voice_me
bind pubm - "*Sends:«1/2»*" voice_me
bind pubm - "*Sends:«1/3»*" voice_me


proc voice_me {nick uhost hand chan text} {
  if {[botisop $chan]==1} {
    if {[isop $nick $chan]==0 && [isvoice $nick $chan]==0} {
      putserv "mode $chan +v $nick"
      #puthelp "PRIVMSG $nick :Thank You for Serving in $chan"
    }
  }
}
this will voice servers that match "*Sends:[0/1]*" in their ad.. what i'm really intrested in is this part Sends:[0 or even Sends:[0/ . the other number would really be ilrelavant.... is ther a way i can have a variable to replace that second number like sends:[1/?] instead of adding all kinds of binds to it??
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Well you've already discovered the use of wildcards, why don't you just use those?

*Sends: <1/*>*

something like that
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

DOH!!!!!!!!!!!!!!!!


thanks
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

ok so this is what i got now....

Code: Select all

bind pubm - "*Sends:[1/*]*" voice_me
bind pubm - "*Sends:«1/*»*" voice_me

proc voice_me {nick uhost hand chan text} {
  if {[botisop $chan]==1} {
    if {[isop $nick $chan]==0 && [isvoice $nick $chan]==0} {
      putserv "mode $chan +v $nick"
      #puthelp "PRIVMSG $nick :Thank You for Serving in $chan"
    }
  }
}
bind pubm - "*Sends:[0/*]*" de-voice_me
bind pubm - "*Sends:«0/*»*" de_voice_me

proc de-voice_me (nick uhost hand chan text) {
  if {[botisop $chan]==1} {
    if {[isop %nick $chan]==0 && [isvoice $nick $chan]==0} {
      putserv "mode $chan -v $nick"
      #puthelp "PRIVMSG $nick :Your server is no longer active in $chan"
    }
  }
}
is there a better way to to this????
or is this okay as is?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

I would use a queue instead of sending the mode changes right away. That way, the bot isn't doing mode changes every 2 seconds. Make it so that instead of putserv, you just add the person to a queue. Then, once a minute (bind time, or a timer), give +v to everyone in the add queue, -v to everyone in the remove queue.
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

okay, i understand what your saying, but how would i do this?
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

is there anyone that can help me with this?? i've got the base (i gugess) but i like the suggestion of having the the servers put into a delayed queue. but i don't know how to do this.......
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Here's a hint for one way to do it. Have two global variables, voice_add and voice_remove. Now, in your bind for adding +v, instead of putserv, you have to do this:

search through the voice_remove list, if he's there remove him

add him to the voice_add list

And instead of -v, do this:

search through the voice_add list, if he's there remove him

add him to the voice_remove list

See how it works? One list keeps track of who to give +v to, the other keeps track of who to take away +v from. One person can't be in both lists, so you have to check the other list before adding to either one.

Then you need a timer or a bind time to execute every two minutes (or however long you want). In that proc, you simply do putserv -v for each person in the voice_remove list, and +v for each person in the voice_add list. Then clear both lists.
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

this is what have now... it's not much different.. cause i'm having trouble finding information on how to have it put the the +v and -v in a list and have it read back an forth accordingly .... also i cant find any info on adding queue lists either...... either i'm not looking in the right places or i'm missing somthing...lol probally both???.
but anyways here it is..:

Code: Select all

bind pubm - "*Sends:[1/*]*" voice_me
bind pubm - "*Sends:«1/*»*" voice_me

proc voice_me {nick uhost hand chan text} {
  if {[botisop $chan]==1} {
    if {![isop $nick $chan] && ![isvoice $nick $chan]} {
      timer 5 [putserv "mode $chan +v $nick"] 
      #puthelp "PRIVMSG $nick :Thank You for Serving in $chan"
    }
  }
}
bind pubm - "*Sends:[0/*]*" de-voice_me
bind pubm - "*Sends:«0/*»*" de_voice_me

proc de-voice_me (nick uhost hand chan text) {
  if {[botisop $chan]==1} {
    if {[isop %nick $chan] && [isvoice $nick $chan]} {
      putserv "mode $chan -v $nick"
    }
  }
}
i appreciate the suggestions :)
g
grinch157
Halfop
Posts: 42
Joined: Tue Nov 11, 2003 4:34 pm

Post by grinch157 »

okay there seems to a problem with the bind commands , but how eles wuld i be able to put them..???
Locked