mIRC Homepage

Almost done

Posted By: yayah1

Almost done - 23/02/06 11:11 PM

i need to know why my script
Code:
 on *:TEXT:!price *:#: {
  var $item = $replace($2-, $chr(32), $chr(95))
  .msg $nick Price of $2- is $readini(prices.ini, Prices, %item)
} 

is not working... i have prices.ini
The first few lines are:
Code:
 [Prices] 
Rune_Scimmy=25-30k 
Santa_Hat=4.5-5.1m(Fluctuating) 
Crusol= Priceless 
XX =Priceless_Sexy_etc. 
tuna=80-120gp 
MasterCard=Priceless  


i was told to use that script and it would work... when i type
!price XX it sends me a msg and says (16:10:45) <Price|Bot> Price of XX is

It has no price on it.. like it is not even reading the .ini file..
Please help me

~yayah 1
Posted By: RusselB

Re: Almost done - 23/02/06 11:13 PM

You're trying to set an identifier $item as a variable.
Change it to %item and it should work fine
Posted By: yayah1

Re: Almost done - 23/02/06 11:16 PM

I did that and it still don't work... do i have it all right now?

Code:
 on *:TEXT:!price *:#: {
  var %item = $replace($2-, $chr(32), $chr(95))
  .msg $nick Price of $2- is $readini(prices.ini, Prices, %item)
} 


~yayah 1
Posted By: RusselB

Re: Almost done - 23/02/06 11:33 PM

Check your INI file and enxure that the [Prices] heading is hard set to teh left hand side. I just noticed in your post that it's indented. I also noticed that one item (can't recall which one right now) has a space between the name and the = sign.

In both (and any other cases like that) ensure that there are no spaces.

If that doesn't fix it, then I'm out of ideas from what you've provided, as the code is now formatted correctly.

P.S.: You do know that you can't test these yourself. You have to either put the code on another copy of mIRC and then test it, or get someone else to issue teh !price command.
Posted By: yayah1

Re: Almost done - 24/02/06 12:08 AM

I do know that... i am going to try that now... it still is not working.. there are no spaces in it at all.....

~yayah 1
Posted By: SladeKraven

Re: Almost done - 24/02/06 12:26 AM

Your above code worked for me of course I did modify the contents of the cofiguration file to remove unnecessary spaces.

[Prices]
Rune_Scimmy=25-30k
Santa_Hat=4.5-5.1m(Fluctuating)
Crusol=Priceless
XX=Priceless_Sexy_etc.
tuna=80-120gp
MasterCard=Priceless

Try replacing this with the data in your INI file. smile

Note: How did this get a 5 star rating?

-Andy
Posted By: TheXX

Re: Almost done - 24/02/06 12:33 AM

Hai, I am glad to see you are using my hashtable I posted at SwiftIRc forums.

Quote:
As how to access and use this data is the cache for moochers : ))
on mIRC client, /help $hget & /help $replace : ))
or better yet:
/help hash tables


/help hash tables : )

Quote:
Check your INI file and enxure that the [Prices] heading is hard set to teh left hand side. I just noticed in your post that it's indented. I also noticed that one item (can't recall which one right now) has a space between the name and the = sign.

THe hashtable information was supplied correctly by me, so futher configuration was indeed a user's error. (There was no idententions or spaces)

Exclude any spaces between the " = " signs.
ITEM=Value should be the format, Value may have spaces, In ITEM underscores are used as spaces and is required. Thanks.

Quote:
Note: How did this get a 5 star rating?

Yes very unusual. confused
Posted By: RusselB

Re: Almost done - 24/02/06 12:38 AM

Where in any of the posts for this topic, preceeding yours, is a hash table even mentioned?

This uses a ini file, not a hash table.

It got a 5 star rating because someone (and only one person) bothered to rate the topic, and they gave it 5 stars. (5 stars * 1 submission / 1 submission = 5 stars) laugh
Posted By: SladeKraven

Re: Almost done - 24/02/06 12:42 AM

Quote:

Exclude any spaces between the " = " signs.
ITEM=Value should be the format, Value may have spaces, In ITEM underscores are used as spaces and is required. Thanks.


This has been said more than once already. smile

-Andy
Posted By: TheXX

Re: Almost done - 24/02/06 12:43 AM

Quote:
Where in any of the posts for this topic, preceeding yours, is a hash table even mentioned?

This uses a ini file, not a hash table.


Didn't read the prices.ini, nonetheless, still wouldn't make that much of a difference.

Anyways if you use hashtable, I would be most happy to give you a script reading it versus using ini's.

Quote:
This has been said more than once already.

No harm in saying it twice. smile
© 2020 mIRC Discussion Forums