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.

Need codes :)

Old posts that have not been replied to for several years.
Locked
g
galaxyboy

Post by galaxyboy »

Hi,

Is there anyway to code this script such that it will set bot to be autoaway with preset reasons upon connected to the IRC Server? Next, is there anyway to make it set autoaway if there's a netspilt?

If it's possible, how can it be done? Can someone kindly do some coding on it?

Thanks :smile:
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

It is easy to make it set itself away on connection to the server.

It's not easy to set itself away on netsplits though. Not all servers provide a detectable netsplit message. It will be allmost imposible to detect them if no1 getting lost in the split is in the room.

Here is the code to the current detectable way

Code: Select all

set areas {
{1 away reason}
{another away reason}
{think of some more}
}

bind evnt - "connect-server" away:connect
proc away:connect {t} {
  global areas
  putserv "AWAY [lindex $areas [rand [llength $reas]]]"
}

bind splt - "*" away:split
proc away:split {nick uh hand chan} {
  global areas
  putserv "AWAY [lindex $areas [rand [llength $reas]]]"
}
This only marks the bot as away. There was nothing noted as to when it should be marked as returned.
g
galaxyboy

Post by galaxyboy »



<font size=-1>[ This Message was edited by: galaxyboy on 2001-11-30 02:43 ]</font>
g
galaxyboy

Post by galaxyboy »

err ppslim,

the code doesn't seems to work. The bot doesn't set itself away on-connect. There's no tcl error though ..
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

OK - part 1.

change
putserv "AWAY [lindex $areas [rand [llength $reas]]]"
to
putserv "AWAY [lindex $areas [rand [llength $areas]]]"
You will see 2 lines the same in the script, change both.

As for the connect-server script not working, add a putlog line in the script, see it that proves the script is being called.

Some IRC server set you as returned upon the first receiveing the first non-automated command fromt he client. A auto-mated command is classed as somthing that should be returned automaticaly byt he client, like a ping. This maybe causing the problems.

If the putlog line is displayed, then yes, this is the problem.
W
Wcc
Master
Posts: 278
Joined: Sun Oct 28, 2001 8:00 pm
Location: USA
Contact:

Post by Wcc »

connect-server is triggered when eggdrop starts connecting to the server. Using init-server would better suit what you are trying to do, as it triggers once connected.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

EEK - yup
P
Petersen
Owner
Posts: 685
Joined: Thu Sep 27, 2001 8:00 pm
Location: Blackpool, UK

Post by Petersen »

personally I prefer binding these kinds of events to raw 001, though when you do that you gotta be 101% sure it ain't gonna return 1 and stop the bot noticing its connected.
g
galaxyboy

Post by galaxyboy »

Ok, i've changed it to init-server.
It's working fine, except, it has one problem now.
set areas {
{1 away reason here}
}
It is only able to display the reason 1. Not the rest of the line. Any ideas?
g
galaxyboy

Post by galaxyboy »

Ok, alright. Got it.
I changed the code to
set away [lindex $areas [rand [llength $areas]]]
set aaway ${away}
putserv "AWAY :$aaway"
}
It works perfectly now :smile: Thanks for all the help guys :smile:
Locked