home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / comms_networking / irclient / !IRClient / Scripts / Modules / AutoGreet (.txt) next >
Encoding:
RISC OS BBC BASIC V Source  |  1997-03-20  |  3.0 KB  |  111 lines

  1.  >AutoGreet
  2.  Example auto-greet script
  3.  Justin Fletcher
  4.  25 Dec 1996 : JF: Started                           v1.00
  5.  29 Dec 1996 : JF: Added online toggling             v1.01
  6.  30 Dec 1996 : JF: Added configuration               v1.02
  7.  30 Dec 1996 : JF: Added a delay                     v1.03
  8.  25 Jan 1997 : JF: Added auto-op for ArcIRC          v1.04
  9.  0,"This is an IRClient script and cannot be run."
  10.  Initialise this module
  11. InitialiseModule
  12.  Configuration
  13. StartupStatus("Initialising AutoGreet...")
  14. /autogreet=
  15. DB_ReadConfig("AutoGreet_On"))
  16.  Pass on to other modules
  17.  Give ourselves a sensible name
  18. Overload_ScriptInfo(num)
  19.  ret$
  20.  num=0 
  21. # ret$="AutoGreet v1.03 (Gerph)"
  22.  ret$=
  23. @(num-1)
  24.     =ret$
  25. Overload_On_Join(nick$,chan$,uid$)
  26.  Call the original routine
  27. @(nick$,chan$,uid$)
  28.  Install the call back to say hi
  29.  autogreet 
  30. AddCallBack("AutoGreet",200,
  31. Strdup(nick$+" "+chan$))
  32.  We're being called back
  33. Overload_CallBack(name$,private)
  34.  nick$,chan$
  35.  name$="AutoGreet" 
  36.  It's us - decode the private word
  37. -* nick$=
  38. $(private),
  39. $(private)," ")-1)
  40. .  chan$=$(private+
  41. (nick$)+1)
  42.  And say our bit
  43. Say(chan$,"Hi "+nick$)
  44. Capitalise(nick$)="ArcIRC" 
  45. SendToIRC("MODE "+chan$+" +o "+nick$)
  46.  /very/ important to release the memory
  47. Release(private)
  48. @(name$,private)
  49. Overload_UnknownCommand(com$,str$)
  50.  com$ 
  51.  "AUTOGREET"
  52.   val=
  53. boolean(str$)
  54.  val 
  55.     autogreet=val
  56. CA    
  57. DisplayInfo("AutoGreet turned "+
  58. booltext(autogreet),"")
  59. E9    
  60. DisplayWarning("Syntax: AutoGreet <boolean>","")
  61. @(com$,str$)
  62.  Enumerate module names
  63. Overload_ConfigModName(count)
  64.  ret$
  65.  count=0 
  66.  ret$="AutoGreet"
  67.  ret$=
  68. @(count-1)
  69. T    =ret$
  70.  What options do we provide ?
  71. Overload_ConfigOptions(module$)
  72.  module$="AutoGreet" 
  73. DisplayConfig("")
  74. DisplayConfig("-- AutoGreet configuration --")
  75. DisplayConfig("You can configure :")
  76. DisplayConfig("  Active : Whether greet on join is active")
  77. @(module$)
  78.  How do we configure things
  79. Overload_ConfigCommand(module$,com$,str$)
  80.  module$="AutoGreet" 
  81.  com$ 
  82.  "ACTIVE"
  83.    val=
  84. boolean(str$)
  85.  val=-2 
  86. i2    
  87. DisplayConfig("Syntax: Active <boolean>")
  88.     autogreet=val
  89. l3    
  90. DB_WriteConfig("AutoGreet_On",
  91.  autogreet)
  92. m=    
  93. DisplayConfig("Set Active to "+
  94. booltext(autogreet))
  95.  "LIST"
  96. DisplayConfig("")
  97. r7   
  98. DisplayConfig("Active : "+
  99. booltext(autogreet))
  100. s6   a$=
  101. booltext(
  102. DB_ReadConfig("AutoGreet_On")))
  103. t.   
  104. DisplayConfig("  (Configured "+a$+")")
  105.  "HELP"
  106. w'   
  107. Overload_ConfigOptions(module$)
  108. z/   
  109. DisplayConfig("Command not recognised")
  110. @(module$,com$,str$)
  111.