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.

Creating a Script for moving networks and informing users

Old posts that have not been replied to for several years.
Locked
W
Weirdo
Master
Posts: 265
Joined: Sat Apr 27, 2002 8:00 pm
Location: Manchester, England

Creating a Script for moving networks and informing users

Post by Weirdo »

hello :)

Well, my irc channel is moving networks on friday, so i need to quickly code a script to announce this to people. I made the script below, but since this is using two bits of code i never used before, i am not sure if they will work. Since i cant test on my bot, without proving to be a pain in the ass to channel users, i would ask if any of you can check this for me?

Code: Select all

#Cometanime Network move script

set chanl(main) "#weirdo"
set network "irc.faereal.net"
set notice(onjoin) "Welcome to the Old Cometanime IRC Channel. The channel is in a process of moving to $network . All channel services being moved to there. Do !info in channel and I will send you information on how to set your client up, and how to connect to the new network"
set notice(public) "The #cometanime Membership have moved to the new #cometanime channel on $network .Hope to see you there. For help on accessing the new channel, do !info in the public channel."

bind join - "$chanl(main) *" join:onchanjoin

proc join:onchanjoin {nick uhost hand chan} {
	global chanl network notice
	putserv "Notice $nick :$notice(onjoin)"
	putlog "$nick just joined $chanl(main)"
}

	
proc pubnotice {} {
	global chanl network notice
	for {set number 1} {} {} {
		timer 15 [putserv "Notice $chanl(main) :$notice(public)
	}
	putlog "Notice Applied to $chanl(main)"
}
The For loop is quite confusing to me. Have never got the hang of loops before, and this:
*The syntax of a [for] command is [for { <start> } { <check> } { <loop> } { <body> }].*

The <start> is the command you want to be executed before the loop starts.
This can be setting a string to 0 for instance.

The <check> is the check that is made while the loop is running and works in the same way as the
check in the [while] loop.

The <loop> is the command you want to be executed every time a loop has ended.
This can be increasing a string with 1 for instance.
... just confused me more. As i not sure if this is the right one i need. Want it to keep running, but wait for 15 mins between displaying the messages. Would a while loop work better?

I have chanserv doing the on join msg, but since that is why we moving, chanserv is buggy, well i making an onjoin thing anyway.

Thank you in advance

Seb [/code]
Locked