|
Joined: Feb 2006
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 9 |
i need to know why my script 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: [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
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
You're trying to set an identifier $item as a variable. Change it to %item and it should work fine
|
|
|
|
Joined: Feb 2006
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 9 |
I did that and it still don't work... do i have it all right now? on *:TEXT:!price *:#: {
var %item = $replace($2-, $chr(32), $chr(95))
.msg $nick Price of $2- is $readini(prices.ini, Prices, %item)
} ~yayah 1
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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.
|
|
|
|
Joined: Feb 2006
Posts: 9
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Feb 2006
Posts: 9 |
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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. Note: How did this get a 5 star rating? -Andy
|
|
|
|
Joined: Feb 2006
Posts: 4
Self-satisified door
|
Self-satisified door
Joined: Feb 2006
Posts: 4 |
Hai, I am glad to see you are using my hashtable I posted at SwiftIRc forums. 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 : ) 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. Note: How did this get a 5 star rating? Yes very unusual.
Last edited by TheXX; 24/02/06 12:40 AM.
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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)
Last edited by RusselB; 24/02/06 12:43 AM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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. -Andy
|
|
|
|
Joined: Feb 2006
Posts: 4
Self-satisified door
|
Self-satisified door
Joined: Feb 2006
Posts: 4 |
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. This has been said more than once already. No harm in saying it twice.
Last edited by TheXX; 24/02/06 12:44 AM.
|
|
|
|
|