mIRC Home    About    Download    Register    News    Help

Print Thread
#248732 21/10/14 12:33 AM
Joined: Oct 2014
Posts: 49
JB_uk Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Oct 2014
Posts: 49
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)
  }

}


Joined: Jan 2004
Posts: 1,352
L
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
Sure it will: at 1000000

Correct the right side of the third and fourth conditions from > to < (like your previous lines).

Last edited by Loki12583; 21/10/14 02:21 AM.
Joined: Oct 2014
Posts: 49
JB_uk Offline OP
Ameglian cow
OP Offline
Ameglian cow
Joined: Oct 2014
Posts: 49
Yup, it was one of those things we just didn't look for. Cheers Loki :')

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
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.

Joined: Jan 2004
Posts: 1,352
L
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,352
Code:
if ($readini(Points.ini,$+(#,.,$nick),Points) == $null)

Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
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?

Last edited by Ahramanyu; 29/10/14 02:17 AM.
Joined: Dec 2008
Posts: 1,513
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,513
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
}


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Apr 2014
Posts: 14
A
Pikka bird
Offline
Pikka bird
A
Joined: Apr 2014
Posts: 14
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?

Joined: Dec 2008
Posts: 1,513
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,513
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.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-

Link Copied to Clipboard