mIRC Homepage
Posted By: JB_uk Problem with Ranks - 21/10/14 12:33 AM
This rank script works up to 1000 points however when this value is exceeded it will no longer give a response.
Anyone able to shed any light on this, or even offer a fix?

Code:
on *:text:!rank:#:{

  if (($readini(Points.ini,$+(#,.,$nick),Points) >= 0) && ($readini(Points.ini,$+(#,.,$nick),Points) < 750)) { 
    msg # $nick is a solid gold mug. Is that even a good idea? Thank you so much for your support. You can now slap people. Keep it up! 
    set %hug $addtok(%hug,$nick,32)
    set %slap $addtok(%slap,$nick,32)
    set %linkok $addtok(%linkok,$nick,32)
    set %qok $addtok(%qok,$nick,32)
  }

  elseif (($readini(Points.ini,$+(#,.,$nick),Points) >= 750) && ($readini(Points.ini,$+(#,.,$nick),Points) < 1000)) { 
    msg # $nick is a diamond encrusted kettle. That's really something! You're the best, thankyou so much for your support. Keep it up! 
    set %hug $addtok(%hug,$nick,32)
    set %slap $addtok(%slap,$nick,32)
    set %linkok $addtok(%linkok,$nick,32)
    set %qok $addtok(%qok,$nick,32)
  }

  elseif (($readini(Points.ini,$+(#,.,$nick),Points) >= 1000) && ($readini(Points.ini,$+(#,.,$nick),Points) > 1000000)) { 
    msg # $nick is now a crystal teapot full of the finest English breakfast tea around! Congratulations! I can't thank you enough for all of your support, you've watched over 83 hours of strim! <3 
    set %hug $addtok(%hug,$nick,32)
    set %slap $addtok(%slap,$nick,32)
    set %linkok $addtok(%linkok,$nick,32)
    set %qok $addtok(%qok,$nick,32)
  }

  elseif ($readini(Points.ini,$+(#,.,$nick),Points) >= 1000000) && ($readini(Points.ini,$+(#,.,$nick),Points) > 5000194) { 
    msg # $nick is a timelord. I call hax.
    set %hug $addtok(%hug,$nick,32)
    set %slap $addtok(%slap,$nick,32)
    set %linkok $addtok(%linkok,$nick,32)
    set %qok $addtok(%qok,$nick,32)
  }

}

Posted By: Loki12583 Re: Problem with Ranks - 21/10/14 02:04 AM
Sure it will: at 1000000

Correct the right side of the third and fourth conditions from > to < (like your previous lines).
Posted By: JB_uk Re: Problem with Ranks - 21/10/14 01:51 PM
Yup, it was one of those things we just didn't look for. Cheers Loki :')
Posted By: Ahramanyu Re: Problem with Ranks - 28/10/14 08:21 PM
Need to pull this topic up, as there is something i can't figure out: Currently, the script is deciding it's action on the value of the Points written down in the Points.ini

What would i have to put down, if i want the bot to do a certain action when there is no value for a user in the .ini file? And i don't mean like 0 points or something, i mean literally no value at all.
Posted By: Loki12583 Re: Problem with Ranks - 28/10/14 09:03 PM
Code:
if ($readini(Points.ini,$+(#,.,$nick),Points) == $null)
Posted By: Ahramanyu Re: Problem with Ranks - 28/10/14 10:08 PM
Guess i made a mistake during the writing part then, as your part of the code seems to be about correct.

Code:
on *:text:!loc:#:{
  if ($readini(Locations.ini,$+(#,.,$nick),Location) == !$null) { return }
  writeini -n Locations.ini $nick Location someplace
}


When a person types !loc, i want the bot to read the Location.ini file. If there is no value for the user, i want it to write down the value "someplace" for the user.

Edit: Alright, it is working not the way i edited the code. Problem is, i would like the whole thing to react to ppl who join the channel, instead of typing !loc. I tried this:

Code:
on !*:join:#: { 
  if ($readini(Locations.ini,$+(#,.,$nick),Location) == !$null) { return }
  writeini -n Locations.ini $nick Location someplace
}


Sadly, it dosn't put the person who join the chat in the .ini file, but the bot itself. Where is my error?
Posted By: westor Re: Problem with Ranks - 29/10/14 09:50 AM
Try to use this code:

Code:
on !*:join:#: { 
  if ($readini(Locations.ini,$nick,Location)) { return }
  writeini -n Locations.ini $nick Location someplace
}

on *:text:!loc:#:{
  if ($readini(Locations.ini,$nick,Location)) { return }
  writeini -n Locations.ini $nick Location someplace
}
Posted By: Ahramanyu Re: Problem with Ranks - 29/10/14 11:40 AM
I did some testing today, and came to this conclussion:

Code:
on *:text:!loc:#:{
  if ($readini(Locations.ini,$+(#,.,$nick),Location) >= !$null) { | halt }
  writeini -n Locations.ini $nick Location someplace
}


@westor I also tested out your suggestions, and both times, the command with on text worked. The on join tho dosn't work at all. Any idea why this could be?
Posted By: westor Re: Problem with Ranks - 30/10/14 09:10 PM
Originally Posted By: Ahramanyu
I did some testing today, and came to this conclussion:

Code:
on *:text:!loc:#:{
  if ($readini(Locations.ini,$+(#,.,$nick),Location) >= !$null) { | halt }
  writeini -n Locations.ini $nick Location someplace
}


@westor I also tested out your suggestions, and both times, the command with on text worked. The on join tho dosn't work at all. Any idea why this could be?


When the user joins on the channel the code is writing on the locations.ini the nickname with location to 'someplace' you need to change the 'someplace' to your think there.
© mIRC Discussion Forums