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.

Help with !samode and Channelcheck

Old posts that have not been replied to for several years.
Locked
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Help with !samode and Channelcheck

Post by tessa1 »

Hi,

my egg iss ircop > mode = +aoA

there's a problem to check, if a channel exits on the network.

Script:

Code: Select all

set gogo(operchan) "#operchan"
set gogo(noav) 0
set gogo(botname) "BigBrother"

bind pub -|- !samode    zop:samode

proc zop:samode {nick host hand chan arg} {
  global gogo
  if {![string equal $chan $gogo(operchan)]} {
   return 0
  }
  if {$gogo(noav)} {
   putquick "NOTICE $nick :Not available! Sorry I'm busy!"
   return 0
  }
  set samodechan [lindex [split $arg] 0]
  if {$samodechan == ""} {
   putquick "NOTICE $nick :No channel! Syntax: !samode <#Channel> <+/-chanmode>"
   return 0
  }
  set chanmode [lrange [split $arg] 1 end]
  if {$chanmode == ""} {
   putquick "NOTICE $nick :No mode! Syntax: !samode <#Channel> <+/-chanmode>"
   return 0
  }
   bind RAW -|- 322         go:check
   set gogo(noav) 1   
   set gogo(samodechan) "$samodechan"
   set gogo(chanmode) "$chanmode"
   putquick "LIST $gogo(samodechan)"
  }

proc go:check {from keyword arg} {
global gogo botnick
  if {(![string match "$gogo(samodechan)" $arg])} {
    putquick "PRIVMSG $gogo(operchan) :Please wait • • • •"
    putquick "SAMODE $gogo(samodechan) $gogo(chanmode)"
    putquick "PRIVMSG $gogo(operchan) :Done!"
    set gogo(noav) 0
} else {
    putquick "PRIVMSG $gogo(operchan) :Please wait • • • •"
    putquick "PRIVMSG $gogo(operchan) :There's no chan with this name on the network!"
    set gogo(noav) 0
   }
}
The command !samode works, but when i type a channel that doesn't exist on the network, the script is hanging on with my busy message.

Can you tell me pls, whats wrong?

In the partyline are no errors.

thx4help :)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you need to also bind raw to 401 (No such nick/channel)

you can't catch "no such channel" in 322
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

uhhmmm.... theres no raw 401 reply on /samode or on /list an invalid chan

do you have an idea how to integrate raw 401 ?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

on the contrary, there is 401 reply on LIST with non-existing channel (unless you use broken or non-RFC1459-conforming ircd)
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

i found this in my debug window
-> Some.Network.org LIST #jghguhrtgl
<- :Some.Network.org 321 teSSa Channel :Users Name
<- :Some.Network.org 323 teSSa :End of /LIST
:cry:

I'm using Unreal 3.2.3
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

when i type

/msg #invalidchannel blah

then is a reply 401
<- :Some.Network.org 401 teSSa #invalidchannel :No such nick/channel
i should bind the raw 401 with a channel message...that should work..i think

or do you have a better idea?
t
tessa1
Halfop
Posts: 49
Joined: Mon Apr 18, 2005 12:51 pm
Location: Germany

Post by tessa1 »

I'm using the following and it works :)

Code: Select all

set gogo(operchan) "#operchan"
set gogo(noav) 0
set gogo(botname) "BigBrother"

bind pub -|- !samode    zop:samode

proc zop:samode {nick host hand chan arg} {
  global gogo
  if {![string equal $chan $gogo(operchan)]} {
   return 0
  }
  if {$gogo(noav)} {
   putquick "NOTICE $nick :Not available! Sorry I'm busy!"
   return 0
  }
  set samodechan [lindex [split $arg] 0]
  if {$samodechan == ""} {
   putquick "NOTICE $nick :No channel! Syntax: !samode <#Channel> <+/-chanmode>"
   return 0
  }
  set chanmode [lrange [split $arg] 1 end]
  if {$chanmode == ""} {
   putquick "NOTICE $nick :No mode! Syntax: !samode <#Channel> <+/-chanmode>"
   return 0
  }
   bind RAW -|- 322         go:check
   bind RAW -|- 401         go:msgcheck
   set gogo(noav) 1   
   set gogo(samodechan) "$samodechan"
   set gogo(chanmode) "$chanmode"
   putquick "LIST $gogo(samodechan)"
   putquick "PRIVMSG $gogo(samodechan) :Some.Network.org sets mode: $gogo(chanmode)"
  }

proc go:check {from keyword arg} {
global gogo botnick
  if {(![string match "$gogo(samodechan)" $arg])} {
    putquick "PRIVMSG $gogo(operchan) :Please wait • • • •"
    putquick "SAMODE $gogo(samodechan) $gogo(chanmode)"
    putquick "PRIVMSG $gogo(operchan) :Done!"
    set gogo(noav) 0
    return 1
   }
}

proc go:msgcheck {from keyword arg} {
global gogo botnick
  if {(![string match "No such nick/channel)" $arg])} {
    putquick "PRIVMSG $gogo(operchan) :Please wait • • • •"
    putquick "PRIVMSG $gogo(operchan) :There's no chan with this name on the network!"
    set gogo(noav) 0
    return 1
   }
}
[/code]
Locked