mIRC Homepage
Posted By: Navid Alias + remotes problem Please help! - 20/07/05 05:56 AM
I have this bot script. The remote script works but the alias scripts do not respond eventhough the timers work.
Here is my code!. I'm sorry its a little too big, dont re-write anything for me just see if you can tell me any errors I can fix.
I honestly checked it over like 5 times and I dont why the script dont work. it should.
here is the code in remotes:
Code:
on 1:Text:`* *:%DiGiT: {
  /registered
  var %atk = $right($1,$calc($len($1) - 1))
  var %2 = $2-
  if ($stats($nick,Status,Entered) != Yes) { notice $nick 4ERROR! 10You are not in Battle Arena | halt }
  if ($stats($nick,Status,Atking) == Yes) { notice $nick 4ERROR! 10You are already attacking | halt }
  if ($stats(%2,Status,Entered) != Yes) { notice $nick 4ERROR!10 $+ %2 10is not in Battle Arena | halt }
  if ($moves($nick,%atk,Base-Damage) == $null) { halt }
  var %msg = $bot_stats(Moves, $+ %atk $+ ,msg)
  msg %DiGiT 4 $+ $stats($nick,Stats,Character) $+ 10(12 $+ $nick $+ 10) %msg 4 $+ $stats($2,Stats,Character) $+ 10(12 $+ $2 $+ 10) $+ $chr(32)
  /timer $+ $nick $+ attacking -o 1 $atk.time(%atk) /kiattack %atk $nick %2
}  


Now the codes in the alias:
Code:
atk.time {
  var %atk.time = $bot_stats(Moves,$1,time)
  return %atk.time
}

kiattack {
  var %power = $stats($2,Stats,power)
  set %power $calc(%power + ($stats($2,stats,power) * .8))
  var %speed2 = $stats($2,stats,speed)
  var %speed3 = $stats($3,stats,speed)
  var %speed = $calc(%speed2 - %speed3)
  if (%speed < 0) { var %speed = 1 }
  set %power $round($calc(%power - ($stats($3,stats,defense) / 2)),0)
  var %power = $rand($calc(%power - 10),%power)
  if (%power < 1) { var %power = 0 }
  if (%power == $null) { var %power = 0 }}
    var %rander = $rand(1,15)
    var %ender = $round($calc($stats($2,stats,luck) * .5 * .5 * .5 + 1),0)
    if (%rander <= %ender) { var %power = %power * 3) | var %critical = 7,1( 8,1C11,1ritical 7,1) }
    var %gexp = $round($calc(%power / 5),0)
    if (%gexp <= 0) { var %gexp = 5) }
    set %chp.defense $stats($3,Stats,Defense)
    set %chp.defense %power
    wini $3 Stats Chp %power
    set %atking $stats($2,Status,Atking)
    set %atking No
    wini $2 Status Atking %Atking
    if (%gexp == 0) { msg %DiGiT $2 %msg $3 and did %power damage. }
    if (%gexp != 0) {
      msg %DiGiT $2 hit $3 and did %power damage. $2 gained %gexp experience!. %critical
      wini $2 stats kiexp %gexp
    } 
    /deadcheck $3 $2 
  }
}

deadcheck {
  if ($stats($1,Stats,Chp) < 1) && ($stats($1,Status,Entered == Yes) {
    var %zenny = $stats($2,Stats,Zenny)
    var %zenny.rand = $rand(11,21)
    inc %zenny %zenny.rand
    wini $2 Stats Zenny %zenny
    msg %DiGi 4 $+ $1 10was Destroyed by4 $2
    wini $1 Status Entered no
    wini $1 Status Atking no
    wini $1 Stats Chp 0
  }
}  


Please help, I dont know who else to ask, you guys are the only well advanced enough. Just quickly go over it and any glitches/errors you see please give me a notice.
Posted By: DaveC Re: Alias + remotes problem Please help! - 20/07/05 06:26 AM
(1) you intermixed use of the variable %power as a local and global variable is very strange and may be causing some problems, I cant see that you need to be using SET to create a global value so you should just use var %power = each time (the var is optional after the first time, i always leave it in just incase)

(2) this line has an extra } if (%power == $null) { var %power = 0 }}

(3) is there ment to be a ) on the 5) on this line if (%gexp <= 0) { var %gexp = 5) }

(4) there maybe other things but those were the first ones that stuck out to me.
Posted By: Navid Re: Alias + remotes problem Please help! - 20/07/05 06:40 AM
OMG THANK You!. It worked.
Finally lol
small glitch in var %power laugh thanks again dude. Appriciate it.

EDIt: I think I have /deadcheck or I'm not sure cause (when I used the command, it did the damage of 58 when the $2 had only 18 Hp)
Posted By: Navid Re: Alias + remotes problem Please help! - 20/07/05 05:43 PM
I see nothing wrong with the /deadcheck. and its not working blush :
* /if: invalid format (line 125, aliases.ini)
Posted By: SladeKraven Re: Alias + remotes problem Please help! - 20/07/05 05:51 PM
I believe you missed closing ) parentheses.
Code:
deadcheck {
  if ($stats($1,Stats,Chp) &lt; 1) &amp;&amp; ($stats($1,Status,Entered == Yes)[color:red])[/color] {
    var %zenny = $stats($2,Stats,Zenny)
    var %zenny.rand = $rand(11,21)
    inc %zenny %zenny.rand
    wini $2 Stats Zenny %zenny
    msg %DiGi 4 $+ $1 10was Destroyed by4 $2
    wini $1 Status Entered no
    wini $1 Status Atking no
    wini $1 Stats Chp 0
  }
} 


-Andy
Posted By: Navid Re: Alias + remotes problem Please help! - 20/07/05 06:24 PM
Thanks Andy, you were right! Sometimes its the smallest mistake that cause the biggest problem lol ^_^.
Anyone wanna take a peak at:
Code:
 on 1:Text:`* *:#: {
  var %atk = $right($1,$calc($len($1) - 1))
  var %2 = $2-
  var %topics = $ini(Bot_Stats\Moves.stats,0)
  var %num = 1
  while (%num &lt;= %topics) {
    var %use = $ini(Bot_Stats\moves.stats,%num)
    var %name = $bot_stats(Moves.stats,np,%use,Arena-banned)
    if (%name == Yes) { notice $nick 4 $+ %atk 10is a banned/restricted move }
    inc %num
  }

lol maybe I have small errors but I see nothign wrong with it blush smile
Posted By: SladeKraven Re: Alias + remotes problem Please help! - 20/07/05 06:50 PM
I don't know what I'm supposed to be looking at dude, seems ok from where I'm sitting. smile

-Andy
Posted By: PhantasyX Re: Alias + remotes problem Please help! - 20/07/05 07:01 PM

Missing a closing bracket at the bottom.

EDIT
(Reply to post below) - Okay. blush
Posted By: Navid Re: Alias + remotes problem Please help! - 20/07/05 07:05 PM
I'm not missing a bracket lol. I have more codes underneath!.

EDIt: Thanks to PhantasyX we got it fixed!.
Posted By: DaveC Re: Alias + remotes problem Please help! - 21/07/05 12:20 AM
Them annoying little brackets, you have to keep them inline, (i hit mine with a stick!) else they just run off and hide elsewhere in your code, maybe the one in if (%gexp <= 0) { var % gexp = 5) } was the same one that sneaked off from the if ?

smile
© mIRC Discussion Forums