mIRC Home    About    Download    Register    News    Help

Print Thread
#259451 28/11/16 01:54 AM
Joined: Nov 2016
Posts: 4
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Nov 2016
Posts: 4
Code:
alias addLeon {
  if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  var %topic $+($chan,.,$nick)
  var %Leon $calc($readini(Leon.txt,%topic,Leon) + $1)
  writeini -n Leon.txt %topic Leon %Leon
  return %Leon
}
alias lookUpLeon {
  var %topic $+($chan,.,$nick)
  var %Leon $readini(Leon.txt,%topic,Leon)
  return %Leon
}
alias doaddLeon {
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %Leon $calc($readini(Leon.txt,%topic,Leon) + $3)
  writeini -n Leon.txt %topic Leon %Leon
  echo -a Added Leon for %topic
}
alias doremLeon {
  var %topic $+($1,.,$2)
  remini -n Leon.txt %topic Leon
  echo -a Removed Leon for %topic
}

on *:text:!Leon:#:{
  if ((%floodLeon) || ($($+(%,floodLeon.,$nick),2))) { return }
  set -u1 %floodLeon On
  set -u3 %floodLeon. $+ $nick On 
  msg # $nick has $lookUpLeon total leon
}

on $*:text:/!Leon (add|remove)/Si:#:{ 
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !Leon <add|remove> <user> [number] | return }
    writeini -n Leon.txt $+(#,.,$3) Leon $calc($readini(Leon.txt,$+(#,.,$3),Leon) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  msg $chan $3 now has $readini(Leon.txt,$+(#,.,$3),Leon) total leon. }
  else { msg $chan This command is only available to moderators. }
}
on $*:join:#:{
  $+(.timerLeon.,#,.,$nick) 0 60 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}
on $*:part:#:$+(.timerLeon.,#,.,$nick) off
alias -l add.pts {
  writeini -n Leon.txt $1 Leon $calc($readini(Leon.txt,$1,Leon) + 1)
}
alias lookUpXp {
  var %topic $+($chan,.,$nick)
  var %XP $readini(Leon.txt,%topic,XP)
  return %XP
}
on *:text:!xp:#:{
  if ((%floodXP) || ($($+(%,floodXP.,$nick),2))) { return }
  set -u1 %floodXP On
  set -u3 %floodXP. $+ $nick On
  if ($lookUpXp >= 1) {  msg # $nick has $readini(Leon.txt,$+(#,.,$nick),XP) total XP
  }
  else {
    msg # $nick has no XP
  }
}
on $*:text:/!xp (add|remove)/Si:#:{ 
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !Leon <add|remove> <user> [number] | return }
    writeini -n Leon.txt $+(#,.,$3) XP $calc($readini(Leon.txt,$+(#,.,$3),XP) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  msg $chan $3 now has $readini(Leon.txt,$+(#,.,$3),XP) total XP. }
  else { msg $chan This command is only available to moderators. }
}

on *:text:!hp:#:{
  if ((%floodHP) || ($($+(%,floodHP.,$nick),2))) { return }
  set -u1 %floodHP On
  set -u3 %floodHP. $+ $nick On 
  if ( $readini(Leon.txt,$+(#,.,$nick),HP) > 0) {  msg # $nick has $readini(Leon.txt,$+(#,.,$nick),HP) / 3 HP }
  else {
    msg # $nick is riPepperonis
  }
}
on $*:text:/!hp (add|remove)/Si:#:{ 
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !hp <add|remove> <user> [number] | return }
    writeini -n Leon.txt $+(#,.,$3) HP $calc($readini(Leon.txt,$+(#,.,$3),HP) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  msg $chan $3 now has $readini(Leon.txt,$+(#,.,$3),HP) total HP. }
  else { msg $chan This command is only available to moderators. }
}
on !*:join:#:{
  $+(.timerhp.,#,.,$nick) 0 60 add.hp $+(#,.,$nick)
  add.hp $+(#,.,$nick)
}
on !*:part:#:$+(.timerhp.,#,.,$nick) off
alias -l add.hp {
  writeini -n Leon.txt $1 HP $calc($readini(Leon.txt,$1,HP) + 1)
}


Last edited by Footsurequincey; 28/11/16 01:58 AM.
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Yes it's possible.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2016
Posts: 4
F
Self-satisified door
OP Offline
Self-satisified door
F
Joined: Nov 2016
Posts: 4
Ya I figured it out I had two on $*:join:#: commands and it was only parsing the first one


Link Copied to Clipboard