mIRC Homepage
Posted By: Newbie Wildcards on readini - 22/04/15 07:36 PM
Is it possible to have a wildcard on writeini and readini? I want to incorporate a rank system without having to make a separate file, however I also don't want to look up the rank system every time I need to change the points.

For example,
Code:
  writeini -n Points.ini $nick * %points
  
  readini -n Points.ini $nick * %points


So the * is the rank of the individual and the %points would be their points.
Posted By: Loki12583 Re: Wildcards on readini - 22/04/15 09:34 PM
No, there is no /inc or /dec functionality working with files.

You must keep these values available in variables or hash tables which do have /inc and /hinc commands respectively; these can then be written to file.
Posted By: Newbie Re: Wildcards on readini - 23/04/15 02:00 AM
But I don't want to use /inc or /dec. Instead what I want to do is retrieve the value from the file... using readini and then calculate additions or subtractions using writeini.

The file would be written as

file_name

[Username]
Rank = Points

so I would retrieve the points using the readini command but I'm wondering if I can use a wildcard to skip reading the rank.

So to retrieve the points above I would use

$readini file_name username * points

* being the wildcard value in this example.
Posted By: Loki12583 Re: Wildcards on readini - 23/04/15 02:09 AM
Wildcard makes no sense in this context. If you need the rank, you need to read it or have it stored in a variable to avoid the read.

If you have two entities, a "rank" and "points" then the correct way to store this is not "rank = points".

If rank is determined solely by points there's no reason to read it back when updating rank anyway.
Posted By: Newbie Re: Wildcards on readini - 23/04/15 02:53 AM
Rank is a variable so points do not determine the variable. So I'm assuming I would have to use $ini to retrieve the rank and then use that in order to read the file. Then use that same variable to edit the points using writeini. I kinda figured that it wouldn't work I was just making sure.
Posted By: logan_671 Re: Wildcards on readini - 07/07/15 07:04 AM
Code:
on *:text:!mypoints:#: {
if ((%floodmypoints) || ($($+(%,floodmypoints.,$nick),2))) { return }
set -u10 %floodmypoints On
set -u30 %floodmypoints. $+ $nick On
if ($readini(Points.ini,$+(#,.,$nick),Points) > 0) {
msg # $nick has a total of $readini(Points.ini,$+(#,.,$nick),Points) exp points!



is this what you mean?
© mIRC Discussion Forums