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.

someone pls help me, figuring it for hrs!

Old posts that have not been replied to for several years.
Locked
I
Illidan
Voice
Posts: 27
Joined: Sat Oct 26, 2002 1:49 am

someone pls help me, figuring it for hrs!

Post by Illidan »

bind mode - "*-o*" do_cycle

proc do_cycle {nick uhost hand chan mode victim} {
set chan [string tolower $chan]
set uhost [string tolower $uhost]
if {$nick == "" && uhost == "*.services.org" && $victim == "$botnick" && $chan="#dart"} {
putserv "PART $chan"
putserv "JOIN $chan"
}
}

in this case the $nick is the Server name example test1.services.org

It simply doesnt work! Please help.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

In your IF tests, you are checking to see if variable are set to specific text.

IE, it is treating the * literaly, and not as a wildcard.

For this, you have to use some form of matchign function.

Use somthing like the "string match" command.

See the Tcl manual for this, which is available HERE
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

You will also ofcourse, need to change your usage of uhost to $uhost
I
Illidan
Voice
Posts: 27
Joined: Sat Oct 26, 2002 1:49 am

Post by Illidan »

I tried changing to

proc do_cycle {nick uhost chan mode text victim} {
global botnick
set chan "#chan1 #chan2"
if {![string match $nick "*.services.org"]} && {![string match -nocase $victim "$botnick"]} && {![string match "$chan"]} { putserv "PRIVMSG #test :test" }
}

it doesnt work at all
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Post by egghead »

Illidan wrote:I tried changing to
[snip]
if {![string match $nick "*.services.org"]} && {![string tolower "$botnick"]) && {![string match "$chan"])

[snip]

it doesnt work at all
1. "![string match $nick "*.services.org"]". Look up the use of string match and the use of the two arguments and which one of these two can have a glob pattern.

2. ![string match $nick "*.services.org"]. Suppose you get the string match right using comment 1 above. Now $nick will contain the nick like "servicebot". Why are you matching the nick against a hostmask?

3. ![string tolower "$botnick"]. Suppose the botnick is "MyBoT". The command [string tolower $botnick] will convert it to "mybot". And then what?

4. ![string match "$chan"]. Suppose you know what [string match] does based on comment 1, then what should this test do?

5. Besides, it seems you do want to regain ops by cycling the channel. It also seems that the ops will be supplied by a service bot. Isn't there a way to request the ops directly from the service bot instead of cycling the channel.

6. In case the bot gets deeopped, the binding "NEED op" gets triggered. You may want to bind to that instead of the mode change.
I
Illidan
Voice
Posts: 27
Joined: Sat Oct 26, 2002 1:49 am

Post by Illidan »

![string match $nick "*.services.org"] There is no $nick eg. "mybot" cause its a desync server that keeps -o the bot.

![string tolower "$botnick"] Sorry I forgot to include the $victim to it so now it looks like this ![string tolower $victim "$botnick"]

![string match "$chan"] I had set the line set chan "#chan1 #chan2"

The irc network I'm in have some serious netspilt problem which will make the Services to get desync with some server, I need it to detect such problem and perform a cycle on the services.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

hmmm

Post by De Kus »

why cycle the channel? it could make the bot lock itself out if someone sets -o+b or -o+i on the bot. if you have chanserv message chanserv or similar channel services like L or Q simply to reop. and i recommed a bind on

Code: Select all

bind need -|- "*" handle:need
proc handle:need {channel need} {
  global botnick
  switch $need {
    op {
       ...
    }
    unban {
...
if you complet this it makes the bot nearly undefeatable (only fast warbots or DoS attacks will break it) until it gets his access removed from the channel service :D.

PS: okok, being able to read helps a lot, seems you only want to cyle after server deopping, but i dont know why this could be so important

btw. you could try binding "bind mode - "#dart -o" do_cycle" since mask is matching '#channel +/-modes' and always containing a single modechange.
and if you are getting desync punished then try to connect to the highest server (next to hub or hub itself, if it allows clients). this server should deop not your bot, but the other person which is involved in the desync :D.
I
Illidan
Voice
Posts: 27
Joined: Sat Oct 26, 2002 1:49 am

Post by Illidan »

Let me try to explain the problem clearer. Let's take for example in a irc network there is ServerA and ServerB and the services nick is "Q".

When ServerA and ServerB got netspilt from one another, after the spilt ServerA is back with the services "Q" into the channel BUT

ServerA's Q isnt op in that channel.

ServerB's Q is op in that channel

THUS

When Q tries to op my bot in that channel, ServerA will keeps deoping the bot cause ServerA's Q isnt op at all so what I need to do is cycle Q not the bot to make the Q in ServerA to regain its @.

I hope now it gives a clearer picture.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

hmmm

Post by De Kus »

can request serverop? if yes try a mode change -o+o Q Q to resync op status. it will be faster and saver and should resync @ at all servers and clients.

PS: bad servers, that dont sync all after split.
Locked