mIRC Home    About    Download    Register    News    Help

Page 2 of 2 < 1 2
Topic Options
#232475 - 06/06/11 11:10 AM Re: I need help. [Re: Mumra_2790]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.


Edited by Riamus2 (06/06/11 03:01 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232477 - 06/06/11 12:52 PM Re: I need help. [Re: Mumra_2790]
Mumra_2790 Offline
Ameglian cow

Registered: 05/06/11
Posts: 29
For yours Tomao, is there anyway to view the file?

Top
#232478 - 06/06/11 01:15 PM Re: I need help. [Re: Mumra_2790]
Mumra_2790 Offline
Ameglian cow

Registered: 05/06/11
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!

Top
#232479 - 06/06/11 01:21 PM Re: I need help. [Re: Mumra_2790]
Mumra_2790 Offline
Ameglian cow

Registered: 05/06/11
Posts: 29
NVM i fixed it, problem with brackets. Thankyou for all your help!

Mumra

Top
#232481 - 06/06/11 01:52 PM Re: I need help. [Re: Mumra_2790]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Sorry about that. When I copy/pasted from my previous post, I missed a bracket.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232483 - 06/06/11 01:59 PM Re: I need help. [Re: Riamus2]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3496
Loc: France
Might want to writeini -n wink


Edited by Wims (06/06/11 01:59 PM)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#232486 - 06/06/11 03:01 PM Re: I need help. [Re: Wims]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Good point. Changed.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#232491 - 06/06/11 06:49 PM Re: I need help. [Re: Mumra_2790]
Tomao Offline
Hoopy frood

Registered: 07/07/07
Posts: 1129
Loc: United States
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..


Edited by Tomao (06/06/11 07:02 PM)

Top
#232541 - 08/06/11 04:30 PM Re: I need help. [Re: Mumra_2790]
Mumra_2790 Offline
Ameglian cow

Registered: 05/06/11
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

Top
#232542 - 08/06/11 06:27 PM Re: I need help. [Re: Mumra_2790]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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.


Edited by Riamus2 (08/06/11 06:30 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
Page 2 of 2 < 1 2