Andrio_Celos

control.mrc

May 14th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 5.71 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;; BASIC CONTROL
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. raw 421:*:echo -a 4,1Unknown Command: ( $+ $2 $+ ) | echo -a 4,1Location: %debug.location | halt
  6.  
  7. ; EDIT: [Andrio Celos] Regain the regular nickname.
  8. on 1:QUIT: { if ($nick = %bot.name) { /nick %bot.name } | .auser 1 $nick | .flush 1 }
  9. on 1:EXIT: { .auser 1 $nick | .flush 1 }
  10. on 1:PART:%battlechan:.auser 1 $nick | .flush 1
  11. on 1:KICK:%battlechan:.auser 1 $knick | .flush 1
  12. on 1:JOIN:%battlechan:{  .auser 1 $nick | .flush 1 }
  13. on 3:NICK: { .auser 1 $nick | mode %battlechan -v $newnick | .flush 1 }
  14. on *:DNS: {
  15.   if ($isfile($char($nick)) = $true) { writeini $char($nick) info lastIP $iaddress  }
  16.   set %ip.address. [ $+ [ $nick ] ] $iaddress
  17. }
  18.  
  19. on 50:TEXT:!quit*:*:{ /quit $battle.version }
  20.  
  21. on 1:START: {
  22.   echo 12*** Welcome to Battle Arena Bot version $battle.version written by James "Iyouboushi" ***
  23.  
  24.   /.titlebar Battle Arena version $battle.version written by James  "Iyouboushi"
  25.  
  26.   if (%first.run = false) {
  27.     set %bot.owner $readini(system.dat, botinfo, bot.owner)
  28.     if (%bot.owner = $null) { echo 4*** WARNING: There is no bot owner set.  Please fix this now.
  29.     set %bot.owner $?="Please enter the bot owner's IRC nick" |  writeini system.dat botinfo bot.owner %bot.owner }
  30.     else { echo 12*** The bot owner list is currently set to:4 %bot.owner 12***  |  
  31.  
  32.       var %value 1 | var %number.of.owners $numtok(%bot.owner, 46)
  33.       while (%value <= %number.of.owners) {
  34.         set %name.of.owner $gettok(%bot.owner,%value,46)
  35.         .auser 50 %name.of.owner
  36.         inc %value 1
  37.       }
  38.       unset %name.of.owner
  39.     }
  40.  
  41.     set %battlechan $readini(system.dat, botinfo, questchan)
  42.     if (%battlechan = $null) { echo 4*** WARNING: There is no battle channel set.  Please fix this now.
  43.     set %battlechan $?="Please enter the IRC channel you're using (include the #)" |  writeini system.dat botinfo questchan %battlechan }
  44.     else { echo 12*** The battle channel is currently set to:4 %battlechan 12*** }
  45.  
  46.     set %bot.name $readini(system.dat, botinfo, botname)
  47.     if (%bot.name = $null) { echo 4*** WARNING: The bot's nick is not set in the system file.  Please fix this now.
  48.     set %bot.name $?="Please enter the nick you wish the bot to use" | writeini system.dat botinfo botname %bot.name | /nick %bot.name }
  49.     else { /nick %bot.name }
  50.  
  51.     var %botpass $readini(system.dat, botinfo, botpass)
  52.     if (%botpass = $null) {
  53.       echo 12*** Now please set the password you plan to register the bot with
  54.       var %botpass $?="Enter a password"
  55.       writeini system.dat botinfo botpass %botpass
  56.       echo 12*** OK.  Your password has been set to4 %botpass  -- Don't forget to register the bot with nickserv.
  57.     }
  58.  
  59.     $system_defaults_check
  60.   }
  61.  
  62.   if ((%first.run = true) || (%first.run = $null)) {
  63.     echo 12*** It seems this is the first time you've ever run the Battle Arena Bot!  The bot will now attempt to help you get things set up.
  64.     echo 12*** Please set your bot's nick/name now.   Normal IRC nick rules apply (no spaces, for example)
  65.     set %bot.name $?="Please enter the nick you wish the bot to use"
  66.     writeini system.dat botinfo botname %bot.name | /nick %bot.name
  67.     echo 12*** Great.  The bot's nick is now set to4 %bot.name
  68.  
  69.     echo 12*** Please set a bot owner now.  
  70.     set %bot.owner $?="Please enter the bot owner's IRC nick"
  71.     writeini system.dat botinfo bot.owner %bot.owner
  72.     echo 12*** Great.  The bot owner has been set to4 %bot.owner
  73.  
  74.     echo 12*** Now please set the IRC channel you plan to use the bot in
  75.     set %battlechan $?="Enter an IRC channel (include the #)"
  76.     writeini system.dat botinfo questchan %battlechan
  77.     echo 12*** The battles will now take place in4 %battlechan
  78.  
  79.     echo 12*** Now please set the password you plan to register the bot with
  80.     var %botpass $?="Enter a password"
  81.     writeini system.dat botinfo botpass %botpass
  82.     echo 12*** OK.  Your password has been set to4 %botpass  -- Don't forget to register the bot with nickserv.
  83.  
  84.     set %first.run false
  85.     .auser 50 %bot.owner
  86.  
  87.     $system_defaults_check
  88.  
  89.   }
  90. }
  91.  
  92. on 1:CONNECT: {
  93.   ; EDIT: [Andrio Celos] The timer isn't necessary.
  94.  
  95.   ; Join the channel
  96.   /join %battlechan
  97.  
  98.   ; EDIT: [Andrio Celos] Use the NickServ GHOST command.
  99.   ; Send password
  100.   var %bot.pass $readini(system.dat, botinfo, botpass)
  101.   if (%bot.pass != $null) { /.msg nickserv identify %bot.pass |
  102.   if ($me != %bot.name) { /.msg NickServ GHOST %bot.name %bot.pass } }
  103.  
  104.   if (%battleis = on) {
  105.     if ($readini(battle2.txt, BattleInfo, Monsters) = $null) { $clear_battle }
  106.     else { $next }
  107.   }
  108.   if (%battleis = off) { $clear_battle }
  109. }
  110.  
  111.  
  112. on 50:TEXT:!debug dump*:*:{
  113.   var %debug.filename debug_dump $+ $day $+ $rand(a,z) $+ $rand(1,1000) $+ $rand(a,z) $+ .txt
  114.   .copy remote.ini %debug.filename
  115.  
  116.   write %debug.filename ------------------------------------------------------
  117.   write %debug.filename debug location: %debug.location
  118.   write %debug.filename battlefield: %current.battlefield
  119.   write %debug.filename battlefield event number: %battlefield.event.number
  120.   write %debug.filename boss type: %boss.type
  121.   write %debug.filename portal bonus: %portal.bonus
  122.   write %debug.filename holy.aura: %holy.aura
  123.   write %debug.filename five min warning: %darkness.fivemin.warn  
  124.   write %debug.filename battle.rage.darkness: %battle.rage.darkness
  125.   write %debug.filename battle conditions: %battleconditions
  126.   write %debug.filename ai target: %ai.target
  127.   write %debug.filename ai tech: %ai.tech
  128.  
  129.   $display.system.message(4Variables File dumped as file: %debug.filename, private)
  130. }
Advertisement
Add Comment
Please, Sign In to add comment