|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
If you just want total, then all you do is change the nick part to work like the total part...
on *:text:*you sent*:#: {
var %file = $+(prizes,$chan,.ini)
writeini -n %file Total Total $calc($readini(%file,Total,Total) + 1)
writeini -n %file $nick Total $calc($readini(%file,$nick,Total) + 1)
}
on *:text:!prizes*:#: {
var %file = $+(prizes,$chan,.ini)
if (!$2) { msg $chan $iif($readini(%file,Total,Total),$v1,0) prizes sent to $chan $+ . }
else { msg $chan $2 sent $iif($readini(%file,$2,Total),$v1,0) prizes. }
} Keep in mind that if someone using the nick "Total", it will cause problems. If you think that may happen, you can replace Total with something that isn't likely to be used as a nick.
Last edited by Riamus2; 06/06/11 02:01 PM.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jun 2011
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jun 2011
Posts: 29 |
For yours Tomao, is there anyway to view the file?
|
|
|
|
Joined: Jun 2011
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jun 2011
Posts: 29 |
Ok this is what i have for it:
on *:text:*you sent*:#: { var %file = $+(prizes,$chan,.ini) writeini %file Total Total $calc($readini(%file,Total,Total) + 1) writeini %file $nick Total $calc($readini(%file,$nick,Total) + 1)
on *:text:!prizes*:#: { var %file = $+(prizes,$chan,.ini) if (!$2) { msg $chan $iif($readini(%file,Total,Total),$v1,0) prizes sent to $chan $+ . } else { msg $chan $2 sent $iif($readini(%file,$2,Total),$v1,0) prizes. } } }
It saves like this:
[Total] Total=1
[mumra_2790] Total=1
Which is exactly what i need, the only trouble is that when typing !prizes mumra_2790 it now does not return anything!
|
|
|
|
Joined: Jun 2011
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jun 2011
Posts: 29 |
NVM i fixed it, problem with brackets. Thankyou for all your help!
Mumra
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Sorry about that. When I copy/pasted from my previous post, I missed a bracket.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2006
Posts: 4,086
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,086 |
Might want to writeini -n 
Last edited by Wims; 06/06/11 12:59 PM.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jul 2007
Posts: 1,129
Hoopy frood
|
Hoopy frood
Joined: Jul 2007
Posts: 1,129 |
For yours Tomao, is there anyway to view the file? For my example, you may need to have a hash table viewer to see the added items and data values. Once you exit your mIRC, The code will save them in your mIRC directory. Then you can view them from there. But the way hash table store the info is sorta out of order, meaning it's not as clean-looking as the INI file. That said, if you find Riamus2's working like a charm, stick with it. P.S. you can make a little script to loop through the content to view the saved info, but it's convenient to use a viewer. It also adds a bit of an extra work to the existing code..
Last edited by Tomao; 06/06/11 06:02 PM.
|
|
|
|
Joined: Jun 2011
Posts: 29
Ameglian cow
|
OP
Ameglian cow
Joined: Jun 2011
Posts: 29 |
If its possible to get some more help that would be great.
The prizes works a treat but i want to add more:
When someone types "You sent your teddy bear to $nick" it saves like this
[Total] Total=1
[mumra_2790] Total=1
Is there a way for me to do this:
When some one types "You sent $1,000,000 to $nick" i want it to save to a file and save like this
[Total] Total=$1,500,000
[mumra_2790] Total=$1,000,000
[toclafane] Total=$500,000
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Will it always be money sent? If not, how is it going to know how to add money and teddy bears and whatnot together? Or is this going to be completely separate? You will need to decide how you want it all to work together, what the input and output will be as a whole rather than asking for individual parts that don't necessarily go together.
What you want can be done very easily, but I'd rather not have to keep changing it over and over. If you can decide everything you want it to do, plus exactly how you want it to output for everything and what the inputs will look like, then I can set it up fairly quickly.
Last edited by Riamus2; 08/06/11 05:30 PM.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|