home *** CD-ROM | disk | FTP | other *** search
RISC OS BBC BASIC V Source | 1997-03-20 | 3.0 KB | 111 lines |
- >AutoGreet
- Example auto-greet script
- Justin Fletcher
- 25 Dec 1996 : JF: Started v1.00
- 29 Dec 1996 : JF: Added online toggling v1.01
- 30 Dec 1996 : JF: Added configuration v1.02
- 30 Dec 1996 : JF: Added a delay v1.03
- 25 Jan 1997 : JF: Added auto-op for ArcIRC v1.04
- 0,"This is an IRClient script and cannot be run."
- Initialise this module
- InitialiseModule
- Configuration
- StartupStatus("Initialising AutoGreet...")
- /autogreet=
- DB_ReadConfig("AutoGreet_On"))
- Pass on to other modules
- Give ourselves a sensible name
- Overload_ScriptInfo(num)
- ret$
- num=0
- # ret$="AutoGreet v1.03 (Gerph)"
- ret$=
- @(num-1)
- =ret$
- Overload_On_Join(nick$,chan$,uid$)
- Call the original routine
- @(nick$,chan$,uid$)
- Install the call back to say hi
- autogreet
- AddCallBack("AutoGreet",200,
- Strdup(nick$+" "+chan$))
- We're being called back
- Overload_CallBack(name$,private)
- nick$,chan$
- name$="AutoGreet"
- It's us - decode the private word
- -* nick$=
- $(private),
- $(private)," ")-1)
- . chan$=$(private+
- (nick$)+1)
- And say our bit
- Say(chan$,"Hi "+nick$)
- Capitalise(nick$)="ArcIRC"
- SendToIRC("MODE "+chan$+" +o "+nick$)
- /very/ important to release the memory
- Release(private)
- @(name$,private)
- Overload_UnknownCommand(com$,str$)
- com$
- "AUTOGREET"
- val=
- boolean(str$)
- val
- autogreet=val
- CA
- DisplayInfo("AutoGreet turned "+
- booltext(autogreet),"")
- E9
- DisplayWarning("Syntax: AutoGreet <boolean>","")
- @(com$,str$)
- Enumerate module names
- Overload_ConfigModName(count)
- ret$
- count=0
- ret$="AutoGreet"
- ret$=
- @(count-1)
- T =ret$
- What options do we provide ?
- Overload_ConfigOptions(module$)
- module$="AutoGreet"
- DisplayConfig("")
- DisplayConfig("-- AutoGreet configuration --")
- DisplayConfig("You can configure :")
- DisplayConfig(" Active : Whether greet on join is active")
- @(module$)
- How do we configure things
- Overload_ConfigCommand(module$,com$,str$)
- module$="AutoGreet"
- com$
- "ACTIVE"
- val=
- boolean(str$)
- val=-2
- i2
- DisplayConfig("Syntax: Active <boolean>")
- autogreet=val
- l3
- DB_WriteConfig("AutoGreet_On",
- autogreet)
- m=
- DisplayConfig("Set Active to "+
- booltext(autogreet))
- "LIST"
- DisplayConfig("")
- r7
- DisplayConfig("Active : "+
- booltext(autogreet))
- s6 a$=
- booltext(
- DB_ReadConfig("AutoGreet_On")))
- t.
- DisplayConfig(" (Configured "+a$+")")
- "HELP"
- w'
- Overload_ConfigOptions(module$)
- z/
- DisplayConfig("Command not recognised")
- @(module$,com$,str$)
-