Advertisement
Guest User

Untitled

a guest
May 1st, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.00 KB | None | 0 0
  1. /*
  2. FIQ-bot version 3
  3. Totally rewritten
  4. */
  5.  
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;;; ;;;
  8. ;;; ALIASES ;;;
  9. ;;; ;;;
  10. ;;;;;;;;;;;;;;;;;;;;;;;;;
  11.  
  12. alias evalfix { return $(,$+(%,$1)) }
  13. alias getaccess {
  14. var %access = %fiqbot_access_ [ $+ [ $1 ] ]
  15. if (%access == 1) { return Normal user }
  16. elseif (%access == 9) { return Master }
  17. elseif (%access == 10) { return Admin }
  18. elseif (!%access) { return Normal user }
  19. else { return User level %access }
  20. }
  21. alias testarsaken { .notice $1 Test-kommando-extension utf�rt! Testar: $1- | return }
  22. alias initcmd {
  23. if ($1 == -in-channel) { if ($2 == Y) { unset %fiqbot* } }
  24. elseif ($?!="Do you want to unload all FIQ-bot variables?") { unset %fiqbot* }
  25. set %fiqbot_cmd_access 9:[-crl] [nick/host] [level]:Add a nick's host or a host with userlevel [level]. With access-level 9 you can grant 8 or less, with level 10 you can grant full access. Use -r switch for removing access. Use -c switch for check access. Use -l switch for listing connected people with access.
  26. set %fiqbot_cmd_account 9:<password>:Creates an account that you can use in FIQ-bots web-interface (with current nick). If an account on your host already exists, changing password. It's highly recommended to run this command in query.
  27. set %fiqbot_cmd_bf 1:<script>:Evalutes <script> in BF.
  28. set %fiqbot_cmd_channel 2:<channel> [welcome/topic/modes/op/deop/voice/devoice/kick/ban/flags/invite/help] [topic/nick/host/help-page]:Manages the specified channel. For more info, type !FIQ CHANNEL HELP
  29. set %fiqbot_cmd_constant 2:[-cdr] <name> [reply]:Make a custom command in FIQ-bot. The -c switch makes FIQ-bot reply in channel. The -r switch makes FIQ-bot use raw (level 5+). The -d switch deletes the constant. Use &sN for parameter N, &nick for the nick, &chan for the channel.
  30. set %fiqbot_cmd_deop 3:[#channel] <name>:Deops <name> in current channel, or if #channel is specified, deops in #channel.
  31. set %fiqbot_cmd_devoice 2:[#channel] <name>:Devoices <name> in current channel, or if #channel is specified, devoices in #channel.
  32. set %fiqbot_cmd_function 9:<-h/name> [code]:Make a custom function in FIQ-bot. For info, type -h instead of a name.
  33. set %fiqbot_cmd_ghost 10:(nothing):Kills the FIQ online.
  34. set %fiqbot_cmd_help 1:<command>:Displays help about a command.
  35. set %fiqbot_cmd_join 5:<channel>:Makes FIQ-bot joining <channel>.
  36. set %fiqbot_cmd_kick 3:[#channel] <name> [reason]:Kicks <name> out of the current channel, or if #channel is specified, kicks from #channel. If [reason] is specified, it will be used as kick reason.
  37. set %fiqbot_cmd_mode 4:<nick/host/#channel> [+/-flags]:Sets <nick/host/#channel> with flags. If no flags is specified, show current flags. Nick flags is +a (auto-op), +b (auto-ban), +g (auto-voice). Channel flags is +g (voiceall).
  38. set %fiqbot_cmd_official 1:(nothing):Sets the current channel to "official" and prevent the bot from joining this channel again. This can only be done by IRC Operators or people with user level 10 (Admin).
  39. set %fiqbot_cmd_op 3:[#channel] <name>:Ops <name> in current channel, or if #channel is specified, ops in #channel.
  40. set %fiqbot_cmd_part 5:<channel>:Makes FIQ-bot parting <channel>.
  41. set %fiqbot_cmd_prefix 9:[-s] [prefix]:Changes the prefix FIQ-bot use. Use -s switch for showing current prefix.
  42. set %fiqbot_cmd_reload 10:[-u]:Reloads variables. If -u switch is used, unsets all variables and makes you level 10.
  43. set %fiqbot_cmd_remote 10:<command>:Make FIQ-bot use a mIRC command with custom parameters.
  44. set %fiqbot_cmd_rpgstats 1:[-c] <ip>:Makes FIQ return stats in FIQ-RPG. The -c switch makes FIQ-bot reply in channel.
  45. set %fiqbot_cmd_showcommands -1:[filter]:Shows available commands. If [filter] is specified, showing only commands matching [filter]. Possibility to use ? for 1 char match and * for zero-or-more char match.
  46. set %fiqbot_cmd_todo 1:<add <text>/show>:Add a todo or show your todo list
  47. set %fiqbot_cmd_try 5:<statement>:Check if <statement> is true or false.
  48. set %fiqbot_cmd_typeof 1:<command>:Display type of the command <command> (normal, constant, channelconstant or rawconstant)
  49. set %fiqbot_cmd_version 1:(nothing):Return FIQ-bot version
  50. set %fiqbot_cmd_voice 2:[#channel] <name>:Voices <name> in current channel, or if #channel is specified, voices in #channel.
  51. set %fiqbot_cmd_whoami 1:(nothing):Display info about who you are for me.
  52. set %fiqbot_cmd_whois 1:<nick>:Displays info about <nick>.
  53. set %fiqbot_prefix !
  54. if ($1 == -in-channel) { if ($2 == Y) { set %fiqbot_access_ $+ $address($3,2) 10 } }
  55. else { set %fiqbot_access_*!*@ $+ $?="Enter the auth you want to give max-access to" $+ .users.quakenet.org 10 }
  56. if ($1 == -in-channel) {
  57. .notice $3 Loaded FIQ-bot version 3.0- $+ $iif($authinfo,main,alternate) beta, build 3004
  58. }
  59. else {
  60. echo -ag Loaded FIQ-bot version 3.0- $+ $iif($authinfo,main,alternate) beta
  61. echo -ag Build: 3004
  62. }
  63. }
  64. alias mIf {
  65. tokenize 32 $1-
  66. goto $0
  67. :3
  68. if ($1 $2 $3) { return $true } | return $false
  69. :2
  70. if ($1 $2) { return $true } | return $false
  71. :1
  72. if ($1) { return $true } | return $false
  73. return $false
  74. }
  75.  
  76.  
  77. ;;;;;;;;;;;;;;;;;;;;;;;;;
  78. ;;; ;;;
  79. ;;; EVENTS ;;;
  80. ;;; ;;;
  81. ;;;;;;;;;;;;;;;;;;;;;;;;;
  82.  
  83. on *:START:{
  84. if (!%init_done) { initcmd | set %init_done 1 }
  85. con.start
  86. aline @console --------------------------------------------------------------
  87. aline @console FIQ-bot version 3.0- $+ $iif($authinfo,main,alternate) (3001)
  88. if (!$authinfo) {
  89. aline @console Denna version �r en begr�nsad version. Detta inneb�r f�ljande:
  90. aline @console * REMOTE �r avst�ngt
  91. aline @console * Automatisk inloggning �r avst�ngt
  92. }
  93. aline @console --------------------------------------------------------------
  94. aline @console 
  95. aline @console 
  96. aline @console Kopplar upp mot n�tverk...
  97. }
  98. on *:CONNECT:{
  99. aline @console Uppkoppling mot $network klar!
  100. aline @console Loggar in...
  101. if (!$authinfo) {
  102. aline @console 0,4Begr�nsad version! Automatisk auth avst�ngt.
  103. }
  104. else { .auth $authinfo }
  105. aline @console Joinar kanaler...
  106. join #FIQ-bot
  107. }
  108. on *:JOIN:*:{
  109. if (($chan == #FIQ-bot) && ($nick == $me)) {
  110. aline @console FIQ-bot har nu joinat kanalen $chan
  111. aline @console * INFO: Startkommandon klara.
  112. aline @console 
  113. aline @console --------------------------------------------------------------
  114. aline @console FIQ-bot v3.0- $+ $iif($authinfo,main,alternate) (3004)
  115. aline @console --------------------------------------------------------------
  116. aline @console 
  117. aline @console FIQbot_30 $+ $iif($authinfo,M,A) $+ 3004> 
  118. }
  119. if (%official_ [ $+ [ $chan ] ]) { part $chan Official channel | return }
  120. elseif ($nick == $me) {
  121. msg $chan Joined channel. If you want me to part (requires access-level 5), type !FIQ part. If this channel is an official network channel and you're an IRC Operator, type "!FIQ official" for preventing this channel from being joined in the future. You can also just ban me, but it will mean that I can join this channel in the future (if someone command me to join it)
  122. }
  123. if ($evalfix(welcome_ $+ $chan)) { .notice $nick $chr(91) $+ $chan $+ $chr(93) - $evalfix(welcome_ $+ $chan) }
  124. if ($me isop $chan) {
  125. if (%mode_a_ [ $+ [ $address($nick,2) ] ]) { mode $chan +o $nick }
  126. elseif (%mode_g_ [ $+ [ $address($nick,2) ] ]) { mode $chan +v $nick }
  127. elseif (%mode_b_ [ $+ [ $address($nick,2) ] ]) { mode $chan +b $address($nick,2) | kick $chan $nick You've the +b flag }
  128. elseif (%mode_g_ [ $+ [ $chan ] ]) { mode $chan +v $nick }
  129. }
  130. }
  131. on *:TEXT:!showprefix:*:.notice $nick Current prefix: %fiqbot_prefix
  132. on *:TEXT:?FIQ *:*:{
  133. if ($nick == $me) { return }
  134. if (%fiqbot_prefix == $left($1,1)) { continue }
  135. else { return }
  136. goto $iif($(,$+(%,fiqbot_cmd_,$2)),$iif(($gettok($(,$+(%,fiqbot_cmd_,$2)),1,58) <= 1 && (!$gettok($(,$+(%,fiqbot_access_,$address($nick,2))),1,58))) || $gettok($(,$+(%,fiqbot_cmd_,$2)),1,58) <= $(,$+(%,fiqbot_access_,$address($nick,2))),$2,accdenied),unknowncmd)
  137. :accdenied
  138. .notice $nick Access denied. You need level $gettok($(,$+(%,fiqbot_cmd_,$2)),1,58) $chr(124) You are: $getaccess($address($nick,2)) (level $iif(!$gettok($(,$+(%,fiqbot_access_,$address($nick,2))),1,58),1,$gettok($(,$+(%,fiqbot_access_,$address($nick,2))),1,58)) $+ )
  139. return
  140. :unknowncmd
  141. if (%addon_ [ $+ [ $2 ] ]) { %addon_cmd_ [ $+ [ $2 ] ] $nick $chan $3- | return }
  142. elseif (%constant_ [ $+ [ $2 ] ]) {
  143. if (%constantInChannel_ [ $+ [ $2 ] ]) { msg $chan $replace(%constant_ [ $+ [ $2 ] ],&s1,$3,&s2,$4,&s3,$5,&s4,$6,&s5,$7,&s6,$8,&nick,$nick,&chan,$chan) }
  144. elseif (%constantUseRaw_ [ $+ [ $2 ] ]) { raw $replace(%constant_ [ $+ [ $2 ] ],&s1,$3,&s2,$4,&s3,$5,&s4,$6,&s5,$7,&s6,$8,&nick,$nick,&chan,$chan) }
  145. else { .notice $nick $replace(%constant_ [ $+ [ $2 ] ],&s1,$3,&s2,$4,&s3,$5,&s4,$6,&s5,$7,&s6,$8,&nick,$nick,&chan,$chan) }
  146. return
  147. }
  148. elseif (%function_ [ $+ [ $2 ] ]) {
  149. echo -agt Debug: Startar custom funktion!
  150. unset %cmd
  151. var %script = temp_function_ $+ $2
  152. var %line 1
  153. var %x = 1
  154. var %rand = $rand(1,10000)
  155. var %chan_ [ $+ [ %rand ] ] $chan
  156. var %nick_ [ $+ [ %rand ] ] $nick
  157. var %time_ [ $+ [ %rand ] ] $time
  158. var %me_ [ $+ [ %rand ] ] $me
  159. var %string = $1-
  160. while (%x <= $len(%function_ [ $+ [ $2 ] ])) {
  161. var %char = $right($left(%function_ [ $+ [ $2 ] ],%x),1)
  162. .echo -atg Debug: While forts�tter! Kommandostring: %cmd - Det �r if? $iif(%cmd == if,Japp,N�)
  163. if ((%char == $chr(125)) && (%ifStatementProgress)) { inc %x | unset %cmd | unset %space* | var %char = $right($left(%function_ [ $+ [ $2 ] ],%x),1) | unset %ifStatementProgress | unset %statementIsTrue }
  164. elseif (%char == ;) {
  165. .echo -atg Debug: Kommando uppt�ckt! Kommandostring: %cmd
  166. tokenize 32 %cmd
  167. var %cmdUsed = $1
  168. if ((%ifStatementProgress) && (!%statementIsTrue)) { xyzzy }
  169. elseif ($2 == =) {
  170. if ($remove($1,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,_,1,2,3,4,5,6,7,8,9,0)) { .notice $nick Error near ' $+ $1-2 $+ ' - Variable may only contain a-z, A-Z and numbers. | return }
  171. elseif ($1 isnum) { .notice $nick Error near ' $+ $1-2 $+ ' - Variable name cannot be an integer. | return }
  172. if (($1 != me) && ($1 != nick) && ($1 != time) && ($1 != chan)) {
  173. if (($left($3,1) == ") || ($3 isnum)) { var % [ $+ [ $1 ] $+ [ _ ] $+ [ %rand ] ] $noqt($3-) }
  174. elseif (% [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var % [ $+ [ $1 ] $+ [ _ ] $+ [ %rand ] ] % [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] }
  175. else { .notice $nick Error near ' $+ $1-3 $+ ' - Variable " $+ $3 $+ " is unknown or undefined. | return }
  176. }
  177. else { .notice $nick Error near ' $+ $1-2 $+ ' - Reserved variable: " $+ $1 $+ " | return }
  178. }
  179. elseif (($1 == msg) || ($1 == notice) || ($1 == action) || ($1 == ctcp) || ($1 == ctcpreply)) {
  180. echo -agt Debug: Msg-kommando detected!
  181. if (($left($2,1) == ") || ($3 isnum)) { var %msgTarget = $noqt($2) }
  182. elseif (% [ $+ [ $2 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %msgTarget = % [ $+ [ $2 ] $+ [ _ ] $+ [ %rand ] ] }
  183. else { .notice $nick Error near ' $+ $1-2 $+ ' Variable " $+ $2 $+ " is unknown or undefined. | return }
  184. if (($left($3-,1) == ") || ($3 isnum)) { var %message = $noqt($3-) }
  185. elseif (% [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %message = % [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] }
  186. else { .notice $nick Error near ' $+ $1-3 $+ ' - Variable " $+ $3 $+ " is unknown or undefined. | return }
  187. echo -atg Debug: %msgTarget - %message
  188. if ($1 == ctcp) { msg %msgTarget $chr(1) $+ %message $+ $chr(1) }
  189. elseif ($1 == ctcpreply) { notice %msgTarget $chr(1) $+ %message $+ $chr(1) }
  190. elseif ($1 == action) { msg %msgTarget $chr(1) $+ ACTION %message $+ $chr(1) }
  191. else { $1 %msgTarget %message }
  192. }
  193. elseif ($1 == if) { .notice $nick Error near ' $+ $1- $+ ' - the if statement couldn't be parsed. | return }
  194. else { .notice $nick Error near ' $+ $1- $+ ' - command " $+ $1 $+ " is unknown. | return }
  195. ;raw %cmd
  196. unset %cmd
  197. tokenize 32 %string
  198. }
  199. elseif ($asc(%char) == 32) { echo -agt Debug: Space progressas! | var %spaceIsGoingToSet = 1 }
  200. elseif (%space) { echo -agt Debug: Space detected! | %cmd = %cmd %char | unset %space* }
  201. else { %cmd = %cmd $+ %char }
  202. if (%spaceIsGoingToSet) { %cmd = %cmd $+ %char }
  203. ;echo -atg Debug: % $+ x -> %x $+ , % $+ cmd -> %cmd
  204. inc %x
  205. if (%spaceIsGoingToSet) { var %space = 1 }
  206. if (%cmd == if) {
  207. unset %z
  208. unset %whilestop
  209. while (!%whilestop) {
  210. var %char = $right($left(%function_ [ $+ [ $2 ] ],%x),1)
  211. if ($asc(%char) == 32) { echo -agt Debug: Space progressas! | var %spaceIsGoingToSet = 1 }
  212. elseif (%space) { inc %z | %cmd = %cmd %char | unset %space* }
  213. else { %cmd = %cmd $+ %char }
  214. if (%z == 4) { var %whilestop = 1 }
  215. else { echo -atg Debug: %z }
  216. if (%spaceIsGoingToSet) { %cmd = %cmd $+ %char }
  217. inc %x
  218. if (%spaceIsGoingToSet) { echo -agt Spacevariabel settas! | var %space = 1 }
  219. if (!%char) { .notice $nick Error near ' $+ %cmd $+ ' - Unknown error. | return }
  220. }
  221. tokenize 32 %cmd
  222. var %cmdUsed = $1
  223. if ($left($2,1) != $chr(40)) { .notice $nick Error near ' $+ $1-2 $+ ' - no starting paranthesis in the if. | return }
  224. if ($right($4,1) == $chr(41)) { xyzzy }
  225. else { .notice $nick Error near ' $+ $1-4 $+ ' - no closing paranthesis on right place. (charcheck: $right($4,1) $+ ) | return }
  226. if (($3 != ==) && ($3 != >) && ($3 != <) && ($3 != <=) && ($3 != >=) && ($3 != !=)) { .notice $nick Error near ' $+ $1-3 $+ ' - unknown operator. | return }
  227. if ($right($left($2,2),1) == ") { var %v1 = $noqt($left($2,-1)) }
  228. elseif (% [ $+ [ $right($2,-1) ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %v1 = % [ $+ [ $right($2,-1) ] $+ [ _ ] $+ [ %rand ] ] }
  229. else { .notice $nick Error near ' $+ $1-2 $+ ' - Variable " $+ $right($2,-1) $+ " is unknown or undefined. | return }
  230. if ($left($4,1) == ") { var %v2 = $noqt($left($4,-1)) }
  231. elseif (% [ $+ [ $right($4,-1) ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %v2 = % [ $+ [ $right($4,-1) ] $+ [ _ ] $+ [ %rand ] ] }
  232. else { .notice $nick Error near ' $+ $1-4 $+ ' - Variable " $+ $left($4,-1) $+ " is unknown or undefined. | return }
  233. if (%v1 $3 %v2) { var %statementIsTrue = 1 }
  234. if ($5 != $chr(123)) { .notice $nick Error near ' $+ $1-5 $+ ' - missing opening bracket. | return }
  235. var %ifStatementProgress = 1
  236. inc %x %cmd
  237. unset %cmd
  238. tokenize 32 %string
  239. }
  240. else { echo -atg Kommandot �r ingen if, det �r: " $+ %cmd $+ ", allts� en if enligt $chr(36) $+ iif? $iif(%cmd == if,Japp,N�) }
  241. }
  242. if (%cmd) {
  243. tokenize 32 %cmd
  244. if ($1 == $chr(125)) { return }
  245. var %cmdUsed = $1
  246. if ($2 == =) {
  247. if ($remove($1,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,_,1,2,3,4,5,6,7,8,9,0)) { .notice $nick Error near ' $+ $1-2 $+ ' - Variable may only contain a-z, A-Z and numbers. | return }
  248. elseif ($1 isnum) { .notice $nick Error near ' $+ $1-2 $+ ' - Variable name cannot be an integer. | return }
  249. if (($1 != me) && ($1 != nick) && ($1 != time) && ($1 != chan)) {
  250. if (($left($3,1) == ") || ($3 isnum)) { var % [ $+ [ $1 ] $+ [ _ ] $+ [ %rand ] ] $noqt($3-) }
  251. elseif (% [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var % [ $+ [ $1 ] $+ [ _ ] $+ [ %rand ] ] % [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] }
  252. else { .notice $nick Error near ' $+ $1-3 $+ ' - Variable " $+ $3 $+ " is unknown or undefined. | return }
  253. }
  254. else { .notice $nick Error near ' $+ $1-2 $+ ' - Reserved variable: " $+ $1 $+ " | return }
  255. }
  256. elseif (($1 == msg) || ($1 == notice) || ($1 == action) || ($1 == ctcp) || ($1 == ctcpreply)) {
  257. echo -agt Debug: Msg-kommando detected!
  258. if (($left($2,1) == ") || ($3 isnum)) { var %msgTarget = $noqt($2) }
  259. elseif (% [ $+ [ $2 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %msgTarget = % [ $+ [ $2 ] $+ [ _ ] $+ [ %rand ] ] }
  260. else { .notice $nick Error near ' $+ $1-2 $+ ' Variable " $+ $2 $+ " is unknown or undefined. | return }
  261. if (($left($3-,1) == ") || ($3 isnum)) { var %message = $noqt($3-) }
  262. elseif (% [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] != $null) { var %message = % [ $+ [ $3 ] $+ [ _ ] $+ [ %rand ] ] }
  263. else { .notice $nick Error near ' $+ $1-3 $+ ' - Variable " $+ $3 $+ " is unknown or undefined. | return }
  264. echo -atg Debug: %msgTarget - %message
  265. if ($1 == ctcp) { msg %msgTarget $chr(1) $+ %message $+ $chr(1) }
  266. elseif ($1 == ctcpreply) { notice %msgTarget $chr(1) $+ %message $+ $chr(1) }
  267. elseif ($1 == action) { msg %msgTarget $chr(1) $+ ACTION %message $+ $chr(1) }
  268. else { $1 %msgTarget %message }
  269. }
  270. else { .notice $nick Error near ' $+ $1- $+ ' command " $+ $1 $+ " is unknown. | return }
  271. ;raw %cmd
  272. unset %cmd
  273. tokenize 32 %string
  274. }
  275. return
  276. :error
  277. .notice $nick Error reported by MSL (script %script on line %line command $left(%cmd,20) $+ ): $error
  278. }
  279. else { .notice $nick Unknown command ( $+ $2 $+ ). For a list of commands, type !FIQ SHOWCOMMANDS }
  280. return
  281. :ACCESS
  282. if ((!$4) && ($3 != -l)) { .notice $nick Syntax: !FIQ ACCESS [-crl] [nick/host] [level] | return }
  283. if ($3 == -r) {
  284. if ($address($4,2)) {
  285. if ($getaccess($address($nick,2)) == Admin) { unset %fiqbot_access_ [ $+ [ $address($4,2) ] ] | .notice $nick Done. Current access for $4 $+ : $getaccess($address($4,2)) }
  286. else {
  287. if ($evalfix(fiqbot_access_ $+ $address($4,2)) > 8) { .notice $nick You cannot remove access from $4 $+ . User is $getaccess($address($4,2)) | return }
  288. unset %fiqbot_access_ [ $+ [ $address($4,2) ] ] | .notice $nick Done. Current access for $4 $+ : $getaccess($address($4,2))
  289. }
  290. }
  291. else {
  292. if (!%fiqbot_access_ [ $+ [ *!*@ ] $+ [ $4 ] ]) { .notice $nick Host $4 doesn't exists. | return }
  293. if ($getaccess($address($nick,2)) == Admin) { unset %fiqbot_access_ [ $+ [ *!*@ ] $+ [ $4 ] ] | .notice $nick Done. Current access for $4 $+ : $getaccess(*!*@ $+ $4) }
  294. else {
  295. if ($evalfix(fiqbot_access_*!*@ $+ $4) > 8) { .notice $nick You cannot remove access from $4 $+ . User is $getaccess(*!*@ $+ $4) | return }
  296. unset %fiqbot_access_ [ $+ [ *!*@ ] $+ [ $4 ] ] | .notice $nick Done. Current access for $4 $+ : $getaccess(*!*@ $+ $4)
  297. }
  298. }
  299. }
  300. elseif ($3 == -c) {
  301. if ($address($4,2)) { .notice $nick Address: $address($4,5) $chr(124) FIQ-bot access: $getaccess($address($4,2)) }
  302. else { .notice $nick Address: $ial(* $+ $4,1) $chr(124) FIQ-bot access: $getaccess(*!*@ $+ $4) }
  303. }
  304. elseif ($3 == -l) {
  305. .notice $nick Listing connected people with access -1 or 2+ (level:nick)
  306. var %i = 1
  307. while ($var(fiqbot_access_*,%i)) {
  308. echo -agt Debug: $var(fiqbot_access_*,%i) och address �r $right($var(fiqbot_access_*,%i),-15)
  309. if ($ial($right($var(fiqbot_access_*,%i),-15),1)) var %buffer = %buffer $(,$var(fiqbot_access_*,%i)) $+ : $+ $gettok($ial($right($var(fiqbot_access_*,%i),-15),1),1,33) $+ $chr(44)
  310. inc %i
  311. }
  312. .notice $nick $iif(!%buffer,(none),$left(%buffer,-1))
  313. }
  314. else {
  315. if ($address($3,2)) {
  316. if ($getaccess($address($nick,2)) == Admin) { set %fiqbot_access_ [ $+ [ $address($3,2) ] ] $iif($4 > 10,10,$4) | .notice $nick Done. Current access for $3 $+ : $getaccess($address($3,2)) }
  317. else {
  318. if ($evalfix(fiqbot_access_ $+ $address($3,2)) > 8) { .notice $nick You cannot change access for $3 $+ . User is $getaccess($address($3,2)) | return }
  319. set %fiqbot_access_ [ $+ [ $address($3,2) ] ] $iif($4 > 8,8,$4) | .notice $nick Done. Current access for $3 $+ : $getaccess($address($3,2))
  320. }
  321. }
  322. else {
  323. if ($getaccess($address($nick,2)) == Admin) { set %fiqbot_access_ [ $+ [ *!*@ ] $+ [ $3 ] ] $iif($4 > 10,10,$4) | .notice $nick Done. Current access for $3 $+ : $getaccess(*!*@ $+ $3) }
  324. else {
  325. if ($evalfix(fiqbot_access_*!*@ $+ $3) > 8) { .notice $nick You cannot remove access from $3 $+ . User is $getaccess(*!*@ $+ $3) | return }
  326. set %fiqbot_access_ [ $+ [ *!*@ ] $+ [ $4 ] ] $iif($4 > 8,8,$4) | .notice $nick Done. Current access for $3 $+ : $getaccess(*!*@ $+ $3)
  327. }
  328. }
  329. }
  330. return
  331. :ACCOUNT
  332. if (!$authinfo) { .notice $nick This feature is only available in 3.0-main. | return }
  333. if (!$3) { .notice $nick Syntax: !FIQ ACCOUNT <password> | return }
  334. else {
  335. set -u1 %nick $iif(!$evalfix(nick_ $+ $address($nick,2)),$nick,$evalfix(nick_ $+ $address($nick,2)))
  336. set %nick_ $+ $address($nick,2) $nick
  337. set -u1 %password $3
  338. set -u1 %accesslevel %fiqbot_access_ [ $+ [ $address($nick,2) ] ]
  339. sockopen localhost 127.0.0.1 80
  340. }
  341. return
  342. :BF
  343. if (!$3) { .notice $nick Syntax: !FIQ BF <script> | return }
  344. useBf $nick $3-
  345. return
  346. :CHANNEL
  347. if ($3 == WELCOME) {
  348. if (!$4) { .notice $nick Welcome-message for this channel: $iif(!$evalfix(welcome_ $+ $chan),(none),$evalfix(welcome_ $+ $chan)) }
  349. elseif (($4 == none) && (!$5)) { unset %welcome_ $+ $chan $4- | .notice $nick Done. Welcome msg for $chan $+ : $4- }
  350. else { set %welcome_ $+ $chan $4- | .notice $nick Done. Welcome msg for $chan $+ : $4- }
  351. }
  352. elseif ($3 == HELP) {
  353. if (!$4) {
  354. .notice $nick --- Channel management help ---
  355. .notice $nick FIQ-bot supports basic management of channels.
  356. .notice $nick For more info, write !FIQ CHANNEL HELP <topic>
  357. .notice $nick Sub-pages: WELCOME
  358. }
  359. elseif ($4 == welcome) {
  360. .notice $nick Syntax: !FIQ CHANNEL WELCOME <message> $chr(124) Flag required: (none)
  361. .notice $nick Changes the welcome message of current channel.
  362. .notice $nick Example: !FIQ CHANNEL WELCOME this is an awesome welcome message
  363. }
  364. else { .notice $nick Help cannot be found for specified topic. | return }
  365. }
  366. else { .notice $nick Unknown channel command. Commands supported: WELCOME, HELP }
  367. return
  368. :CONSTANT
  369. if (!$4) { .notice $nick Syntax: FIQ constant <keyword> <text>. Parameter support: &s(para-number) | return }
  370. if ($3 == -c) {
  371. if ($evalfix(fiqbot_cmd_ $+ $4)) { .notice $nick Command $4 already exists. | return }
  372. set %constant_ $+ $4 $5-
  373. set %constantInChannel_ $+ $4 1
  374. }
  375. elseif ($3 == -r) {
  376. if ($evalfix(fiqbot_cmd_ $+ $4)) { .notice $nick Command $4 already exists. | return }
  377. if ($evalfix(fiqbot_access_ $+ $address($nick,2)) > 4) { set %constantUseRaw_ $+ $4 1 }
  378. set %constant_ $+ $4 $5-
  379. }
  380. elseif ($3 == -d) {
  381. if (!$evalfix(constant_ $+ $4)) { .notice $nick Constant " $+ $4 $+ " doesn't exists. | return }
  382. unset %constant_ [ $+ [ $4 ] ]
  383. unset %constantInChannel_ [ $+ [ $4 ] ]
  384. unset %constantUseRaw_ [ $+ [ $4 ] ]
  385. }
  386. else {
  387. if ($evalfix(fiqbot_cmd_ $+ $3)) { .notice $nick Command $3 already exists. | return }
  388. set %constant_ $+ $3 $4-
  389. }
  390. .notice $nick Done.
  391. return
  392. :DEOP
  393. if ((!$3) || ((!$4) && ($left($3,1) == $chr(35)))) { .notice $nick Syntax: !FIQ $upper($2) [#channel] <nick> | return }
  394. if ($left($3,1) == $chr(35)) { var %chan = $3 | var %nick = $4 }
  395. else { var %chan = $chan | var %nick = $3 }
  396. if ($me !isop %chan) { .notice $nick I'm not op in %chan | return }
  397. if (%nick !ison %chan) { .notice $nick %nick isn't on %chan | return }
  398. mode %chan -o %nick
  399. .notice $nick Done.
  400. return
  401. :DEVOICE
  402. if ((!$3) || ((!$4) && ($left($3,1) == $chr(35)))) { .notice $nick Syntax: !FIQ $upper($2) [#channel] <nick> | return }
  403. if ($left($3,1) == $chr(35)) { var %chan = $3 | var %nick = $4 }
  404. else { var %chan = $chan | var %nick = $3 }
  405. if ($me !isop %chan) { .notice $nick I'm not op in %chan | return }
  406. if (%nick !ison %chan) { .notice $nick %nick isn't on %chan | return }
  407. mode %chan -v %nick
  408. .notice $nick Done.
  409. return
  410. :FUNCTION
  411. if (!$3) { .notice $nick Syntax: !FIQ FUNCTION <-h/name> [code] | return }
  412. elseif ($3 != -h) {
  413. if (!$4) { .notice $nick $3 contains following code: $evalfix(function_ $+ $3) | return }
  414. set %function_ $+ $3 $4-
  415. .notice $nick Done.
  416. }
  417. else {
  418. if ($4 == 2) {
  419. .notice $nick Page 2 - The [[nick]] used in the "hre" command was a function that returned something. We can call it a identifier. There's many types of default functions. Others is [[chan]], [[time]], [[str]],
  420. .notice $nick [[me]] doing different things. [[chan]], [[time]] and [[me]] works the same as [[nick]] but instead, [[chan]] shows channel, [[time]] current time, [[me]] the botnick.
  421. .notice $nick But functions also can take parameters, as the [[str]] one. For more help, write !FIQ function -h 3
  422. }
  423. elseif ($4 == 3) {
  424. .notice $nick Page 3 - The [[str]] function can take one parameter, a number. The number shows the parameter used in the functions.
  425. .notice $nick Example: If you write this function: !FIQ function hre NOTICE [[nick]] :A parameter: [[str|1]], and then use the function, it will return "A parameter:". Now try write !FIQ hre random
  426. .notice $nick As you see, it returned "A parameter: random" in a notice. For more help, write !FIQ function -h 4
  427. }
  428. elseif ($4 == 4) {
  429. .notice $nick Page 4 - You can also make own identifiers and use them in your functions for returning data.
  430. .notice $nick using the RETURN "special" command. For example, making a "hre2" identifier returning "A nice identifier!", write !FIQ FUNCTION hre2 return A nice identifier!
  431. .notice $nick You can now return "A nice identifier!" only with typing [[hre2]] in your "hre" function. For more help, write !FIQ function -h 5
  432. }
  433. elseif ($4 == 5) {
  434. .notice $nick Page 5 - You can also makes custom functions that take parameters. The parameters used is obetainable with "[[str|N]]" (N = number), just like in a normal function.
  435. .notice $nick For more help, type !FIQ functions -h 6
  436. }
  437. elseif ($4 == 6) {
  438. .notice $nick Page 6 - If statements: If statements is commonly used in more normal scripting and if you're common with it, you already know how it works. If not, an if statement is used to check
  439. .notice $nick if something is true or false and then execute something. An if in FIQ-bot-functions is used this way: "if (statement) $chr(123) command1;command2; $chr(125) $+ ". There's no elseif/else at this moment.
  440. .notice $nick Current operators is == (is equal to), != (is NOT equal to), < (is more than), > (is less than).
  441. }
  442. else {
  443. .notice $nick Page 1 - FIQ-bot supports making own type of functions. You call them as a normal command/constant. Commands is RAW-based but there exists "special" commands. The seperator between commands used is ";".
  444. .notice $nick For example, writing a function returning "abc" in a msg and is named "hre", you write: !FIQ function hre msg nick "abc"
  445. .notice $nick For more help, write !FIQ function -h 2
  446. }
  447. }
  448. return
  449. :GHOST
  450. if (!$authinfo2) { .notice $nick Cannot find auth information, this problably means that this version is 3.0-alternate. | return }
  451. ns ghost $authinfo2
  452. .notice $nick Done.
  453. return
  454. :HELP
  455. if (!$3) { .notice $nick For commands, type SHOWCOMMANDS. For help about a specific command, type !FIQ HELP <command> | return }
  456. .notice $nick Syntax: !FIQ $3 $remove($gettok($(,$+(%,fiqbot_cmd_,$3)),2,58),(nothing)) $chr(124) Access level: $gettok($(,$+(%,fiqbot_cmd_,$3)),1,58)
  457. .notice $nick $gettok($(,$+(%,fiqbot_cmd_,$3)),3,58)
  458. .return
  459. :JOIN
  460. if (!$3) { .notice $nick Syntax: !FIQ JOIN <channel> | return }
  461. if (%official_ [ $+ [ $gettok($3,1,44) ] ]) { .notice $nick This channel is official. The channel couldn't be joined. | return }
  462. join $gettok($3,1,44)
  463. .notice $nick Done.
  464. return
  465. :KICK
  466. if ((!$3) || ((!$4) && ($left($3,1) == $chr(35)))) { .notice $nick Syntax: !FIQ $upper($2) [#channel] <nick> [reason] | return }
  467. if ($left($3,1) == $chr(35)) { var %chan = $3 | var %nick = $4 | var %reason = $5- }
  468. else { var %chan = $chan | var %nick = $3 | var %reason = $4- }
  469. if ($me !isop %chan) { .notice $nick I'm not op in %chan | return }
  470. if (%nick !ison %chan) { .notice $nick %nick isn't on %chan | return }
  471. if (%nick == $me) { .notice $nick I don't kick myself. | return }
  472. kick %chan %nick %reason
  473. .notice $nick Done.
  474. return
  475. :MODE
  476. if (!$3) { .notice $nick Syntax: !FIQ MODE <nick/host> [flags] | return }
  477. if ($left($3,1) == $chr(35)) {
  478. if (!$4) {
  479. var %buffer = +
  480. if (%mode_g_ [ $+ [ $3 ] ]) { var %buffer = %buffer $+ g }
  481. .notice $nick Flags in this channel: $iif(%buffer != +,%buffer,(none))
  482. }
  483. else {
  484. if ($left($4,1) == +) {
  485. if (g isin $4) { set %mode_g_ [ $+ [ $3 ] ] 1 }
  486. }
  487. elseif ($left($4,1) == -) {
  488. if (g isin $4) { unset %mode_g_ [ $+ [ $3 ] ] }
  489. }
  490. .notice $nick Done.
  491. }
  492. }
  493. elseif ($ial($3 $+ *)) {
  494. if (!$4) {
  495. var %buffer = +
  496. if (%mode_a_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ a }
  497. if (%mode_b_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ b }
  498. if (%mode_g_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ g }
  499. .notice $nick Flags for $3 $+ : $iif(%buffer != +,%buffer,(none))
  500. }
  501. else {
  502. if ($left($4,1) == +) {
  503. if (a isin $4) { set %mode_a_ [ $+ [ $address($3,2) ] ] 1 }
  504. if (b isin $4) { set %mode_b_ [ $+ [ $address($3,2) ] ] 1 }
  505. if (g isin $4) { set %mode_g_ [ $+ [ $address($3,2) ] ] 1 }
  506. }
  507. elseif ($left($4,1) == -) {
  508. if (a isin $4) { unset %mode_a_ [ $+ [ $address($3,2) ] ] }
  509. if (b isin $4) { unset %mode_b_ [ $+ [ $address($3,2) ] ] }
  510. if (g isin $4) { unset %mode_g_ [ $+ [ $address($3,2) ] ] }
  511. }
  512. .notice $nick Done.
  513. }
  514. }
  515. else {
  516. if (!$4) {
  517. var %buffer = +
  518. if (%mode_a_*!*@ [ $+ [ $3 ] ]) { var %buffer = %buffer $+ a }
  519. if (%mode_b_*!*@ [ $+ [ $3 ] ]) { var %buffer = %buffer $+ b }
  520. if (%mode_g_*!*@ [ $+ [ $3 ] ]) { var %buffer = %buffer $+ g }
  521. .notice $nick Flags for $3 $+ : $iif(%buffer != +,%buffer,(none))
  522. }
  523. else {
  524. if ($left($4,1) == +) {
  525. if (a isin $4) { set %mode_a_*!*@ [ $+ [ $3 ] ] 1 }
  526. if (b isin $4) { set %mode_b_*!*@ [ $+ [ $3 ] ] 1 }
  527. if (g isin $4) { set %mode_g_*!*@ [ $+ [ $3 ] ] 1 }
  528. }
  529. elseif ($left($4,1) == -) {
  530. if (a isin $4) { unset %mode_a_*!*@ [ $+ [ $3 ] ] }
  531. if (b isin $4) { unset %mode_b_*!*@ [ $+ [ $3 ] ] }
  532. if (g isin $4) { unset %mode_g_*!*@ [ $+ [ $3 ] ] }
  533. }
  534. .notice $nick Done.
  535. }
  536. }
  537. return
  538. :OFFICIAL
  539. if ($getaccess($address($nick,2)) != Admin) {
  540. set -u3 %ircopcheck $nick
  541. set -u3 %chan $chan
  542. who $nick
  543. }
  544. else {
  545. set %official_ $+ $chan 1
  546. part $chan This channel will not be joined anymore.
  547. .notice $nick Done. Channel will now be prevented from joining.
  548. }
  549. return
  550. :OP
  551. if ((!$3) || ((!$4) && ($left($3,1) == $chr(35)))) { .notice $nick Syntax: !FIQ $upper($2) [#channel] <nick> | return }
  552. if ($left($3,1) == $chr(35)) { var %chan = $3 | var %nick = $4 }
  553. else { var %chan = $chan | var %nick = $3 }
  554. if ($me !isop %chan) { .notice $nick I'm not op in %chan | return }
  555. if (%nick !ison %chan) { .notice $nick %nick isn't on %chan | return }
  556. mode %chan +o %nick
  557. .notice $nick Done.
  558. return
  559. :PART
  560. if (!$3) { if ($chan == #FIQ-bot) { .notice $nick I don't part this channel. | return } | else { part $chan | .notice $nick Done. | return } }
  561. if ($3 == #FIQ-bot) { .notice $nick I don't part that channel. | return }
  562. part $3
  563. .notice $nick Done.
  564. return
  565. :PREFIX
  566. if (!$3) { .notice $nick Syntax: %fiqbot_prefix $+ FIQ PREFIX [-s] [prefix] | return }
  567. if ($3 == -s) { .notice $nick Current prefix: %fiqbot_prefix }
  568. else { set %fiqbot_prefix $left($3,1) | .notice $nick Done }
  569. return
  570. :RELOAD
  571. if ($3 == -u) { initcmd -in-channel Y $nick }
  572. else { initcmd -in-channel N $nick }
  573. return
  574. :REMOTE
  575. if (1 == 1) { $3- }
  576. else {
  577. .notice $nick Remote disabled for security reasons.
  578. }
  579. return
  580. :RPGSTATS
  581. var %ip = $iif($3 == -c,$4,$3)
  582. if ($3 == -c) { msg $chan Level: $evalfix(level_ $+ %ip) - EXP: $evalfix(exp_ $+ %ip) $+ / $+ $getExpToLevel($evalfix(level_ $+ %ip)) }
  583. else { .notice $nick Level: $evalfix(level_ $+ %ip) - EXP: $evalfix(exp_ $+ %ip) $+ / $+ $getExpToLevel($evalfix(level_ $+ %ip)) }
  584. return
  585. :SHOWCOMMANDS
  586. .notice $nick Following commands are available for you with access " $+ $getaccess($address($nick,2)) $+ ":
  587. var %i = 1
  588. while ($var(fiqbot_cmd_*,%i)) {
  589. if (($gettok($(,$var(fiqbot_cmd_*,%i)),1,58) <= $evalfix(fiqbot_access_ $+ $address($nick,2))) || (($gettok($(,$var(fiqbot_cmd_*,%i)),1,58) <= 1) && (!$evalfix(fiqbot_access_ $+ $address($nick,2))))) { if ((!$3) || ($3 iswm $right($var(fiqbot_cmd_*,%i),-12))) var %buffer = %buffer $right($var(fiqbot_cmd_*,%i),-12) $+ $chr(44) }
  590. inc %i
  591. }
  592. var %i = 1
  593. while ($var(constant_*,%i)) { var %buffer2 = %buffer2 $right($var(constant_*,%i),-10) $+ $chr(44) | inc %i }
  594. .notice $nick Normal commands: $iif(!$upper($left(%buffer,-1)),(none),$upper($left(%buffer,-1))) $chr(124) Constants: $iif(!$upper($left(%buffer2,-1)),(none),$upper($left(%buffer2,-1)))
  595. return
  596. :TODO
  597. if (!$3) { .notice $nick Syntax: FIQ TODO <show/add/done/clear> | return }
  598. if ($3 == show) {
  599. var %i = 1
  600. while (%todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ]) { inc %i }
  601. if (%i > 5) {
  602. var %i = 1
  603. .notice $nick Todos f�r $nick $+ :
  604. while (%todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ]) {
  605. unset %alreadySentAll
  606. if ($calc(%i % 5) == 1) { var %todobuffer * %todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ] }
  607. else { var %todobuffer %todobuffer $chr(124) * %todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ] }
  608. if ($calc(%i % 5) == 0) { .notice $nick %todobuffer | %alreadySentAll = 1 }
  609. inc %i
  610. }
  611. if (!%alreadySentAll) { .notice $nick %todobuffer | %alreadySentAll = 1 }
  612. }
  613. elseif (%i == 1) { .notice $nick Du har inga todos atm. }
  614. else {
  615. var %i = 1
  616. .notice $nick Todos f�r $nick $+ :
  617. while (%todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ]) {
  618. .notice $nick * %todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ]
  619. inc %i
  620. }
  621. }
  622. }
  623. elseif ($3 == add) {
  624. if (!$4) { .notice Please type at least 1 word. | return }
  625. var %i = 1
  626. while (%todo_ [ $+ [ %i ] $+ [ _ ] $+ [ $address($nick,2) ] ]) { inc %i }
  627. set %todo_ $+ %i $+ _ $+ $address($nick,2) $4-
  628. .notice $nick Added todo %i $+ : $4-
  629. }
  630. return
  631. :TRY
  632. var %tmp = $(,$3-5)
  633. .notice $nick STATEMENT $3-5 $chr(124) RETURNED: $mif(%tmp)
  634. return
  635. :TYPEOF
  636. if (!$3) { .notice $nick Syntax: !FIQ TYPEOF <command> | return }
  637. if (%constantUseRaw_ [ $+ [ $3 ] ]) { var %type = rawconstant }
  638. elseif (%constantInChannel_ [ $+ [ $3 ] ]) { var %type = channelconstant }
  639. elseif (%constant_ [ $+ [ $3 ] ]) { var %type = constant }
  640. elseif (%addon_ [ $+ [ $3 ] ]) { var %type = addon }
  641. elseif (%fiqbot_cmd_ [ $+ [ $3 ] ]) { var %type = normal }
  642. else { .notice $nick Command $3 doesn't exists. | return }
  643. .notice $nick Type of $3 is " $+ %type $+ ".
  644. return
  645. :VERSION
  646. .notice $nick FIQ-bot version 3.0- $+ $iif($authinfo,main,alternate) beta build 3004
  647. return
  648. :VOICE
  649. if ((!$3) || ((!$4) && ($left($3,1) == $chr(35)))) { .notice $nick Syntax: !FIQ $upper($2) [#channel] <nick> | return }
  650. if ($left($3,1) == $chr(35)) { var %chan = $3 | var %nick = $4 }
  651. else { var %chan = $chan | var %nick = $3 }
  652. if ($me !isop %chan) { .notice $nick I'm not op in %chan | return }
  653. if (%nick !ison %chan) { .notice $nick %nick isn't on %chan | return }
  654. mode %chan +v %nick
  655. .notice $nick Done.
  656. return
  657. :WHOAMI
  658. var %buffer = +
  659. if (%mode_a_ [ $+ [ $address($nick,2) ] ]) { var %buffer = %buffer $+ a }
  660. if (%mode_b_ [ $+ [ $address($nick,2) ] ]) { var %buffer = %buffer $+ b }
  661. if (%mode_g_ [ $+ [ $address($nick,2) ] ]) { var %buffer = %buffer $+ g }
  662. .notice $nick Address: $address($nick,5) $chr(124) Your FIQ-bot access: $getaccess($address($nick,2)) $chr(124) You have following flags set: $iif(%buffer != +,%buffer,(none))
  663. return
  664. :WHOIS
  665. if (!$3) { .notice $nick Syntax: !FIQ WHOIS <nick> }
  666. if (!$ial($3)) { .notice $nick $3 doesn't exists, aren't connected or aren't on any channels with me. | return }
  667. var %buffer = +
  668. if (%mode_a_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ a }
  669. if (%mode_b_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ b }
  670. if (%mode_g_ [ $+ [ $address($3,2) ] ]) { var %buffer = %buffer $+ g }
  671. .notice $nick Address: $address($3,5) $chr(124) FIQ-bot access: $getaccess($address($3,2)) $chr(124) $3 has following flags set: $iif(%buffer != +,%buffer,(none))
  672. return
  673. }
  674. RAW 354:*:{
  675. if ($2 == %ircopcheck) {
  676. if (* isin $3) {
  677. set %official_ $+ %chan 1
  678. part %chan This channel will not be joined anymore.
  679. .notice %ircopcheck Done. Channel will now be prevented from joining.
  680. }
  681. else { .notice $nick You haven't enough access and you're not an IRC Operator (or the status couldn't be detected) }
  682. }
  683. }
  684.  
  685. ;;;;;;;;;;;;;;;;;;;;;;;;;
  686. ;;; ;;;
  687. ;;; EVENTS ;;;
  688. ;;; ;;;
  689. ;;;;;;;;;;;;;;;;;;;;;;;;;
  690.  
  691. on *:sockopen:localhost:{
  692. ;to tell the server which file you want to receive
  693. sockwrite -n $sockname GET /fiq-bot/addUser.php?level= $+ %accesslevel $+ &username= $+ %nick $+ &password= $+ %password HTTP/1.0
  694. ;sockwrite -n $sockname GET /fiq-bot/index.php
  695. sockwrite -n $sockname Host: 127.0.0.1
  696. ;this is only needed for a few websites, but it's just more complete to have it ;)
  697. sockwrite -n $sockname user-agent: FIQbot/3.0 (build 3004)
  698. sockwrite -n $sockname Connection: Keep-Alive
  699. sockwrite -n $sockname $crlf
  700. }
  701. on *:sockread:localhost:{
  702. ;same way as in mirc helpfile with the :nextread
  703. if ($sockerr > 0) .notice %nick Error! $sockerr
  704. :nextread
  705. sockread %temp
  706. tokenize 32 %temp
  707. if ($1 == FIQBOTECHO:) { .notice %nick $2- }
  708. echo -s Content: %temp
  709. if (%y) { return }
  710. if ($sockbr == 0) { var %y = 1 }
  711. /*
  712. ;to check if we got the right line, it's pretty easy for this file, but usually more complicated,
  713. ;use $gettok or variables to get the right line.
  714. if (<html> isin %temp) {
  715. ;%temp will contain something like:
  716. ;<html><head><title>Current IP Check</title></head><body>Current IP Address: 217.20.116.184</body></html>
  717. ;an easy way to 'strip' it is with $remove
  718. var %z = $remove(%temp,<html><head><title>Current IP Check</title></head><body>Current IP Address:,</body></html>)
  719.  
  720. ;scon -a is to send a command to all servers mirc is connected to
  721. scon -a localinfo $chr(10) %z
  722. scon -a echo 4 -s ip is set to $ip
  723. }
  724. */
  725. goto nextread
  726. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement