mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Mumra_2790 #232475 06/06/11 10:10 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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...

Code:
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
Mumra_2790 #232477 06/06/11 11:52 AM
Joined: Jun 2011
Posts: 29
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jun 2011
Posts: 29
For yours Tomao, is there anyway to view the file?

Mumra_2790 #232478 06/06/11 12:15 PM
Joined: Jun 2011
Posts: 29
M
Ameglian cow
OP Offline
Ameglian cow
M
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!

Mumra_2790 #232479 06/06/11 12:21 PM
Joined: Jun 2011
Posts: 29
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Jun 2011
Posts: 29
NVM i fixed it, problem with brackets. Thankyou for all your help!

Mumra

Mumra_2790 #232481 06/06/11 12:52 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
Riamus2 #232483 06/06/11 12:59 PM
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Might want to writeini -n wink

Last edited by Wims; 06/06/11 12:59 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #232486 06/06/11 02:01 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Good point. Changed.


Invision Support
#Invision on irc.irchighway.net
Mumra_2790 #232491 06/06/11 05:49 PM
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Originally Posted By: Mumra_2790
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.
Mumra_2790 #232541 08/06/11 03:30 PM
Joined: Jun 2011
Posts: 29
M
Ameglian cow
OP Offline
Ameglian cow
M
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

Mumra_2790 #232542 08/06/11 05:27 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
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
Page 2 of 2 1 2

Link Copied to Clipboard