mIRC Home    About    Download    Register    News    Help

Print Thread
#143422 23/02/06 11:11 PM
Joined: Feb 2006
Posts: 9
Y
yayah1 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Y
Joined: Feb 2006
Posts: 9
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

#143423 23/02/06 11:13 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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

#143424 23/02/06 11:16 PM
Joined: Feb 2006
Posts: 9
Y
yayah1 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Y
Joined: Feb 2006
Posts: 9
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

#143425 23/02/06 11:33 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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.

#143426 24/02/06 12:08 AM
Joined: Feb 2006
Posts: 9
Y
yayah1 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Y
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

#143427 24/02/06 12:26 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
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. smile

Note: How did this get a 5 star rating?

-Andy

#143428 24/02/06 12:33 AM
Joined: Feb 2006
Posts: 4
T
Self-satisified door
Offline
Self-satisified door
T
Joined: Feb 2006
Posts: 4
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

Last edited by TheXX; 24/02/06 12:40 AM.
#143429 24/02/06 12:38 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
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) laugh

Last edited by RusselB; 24/02/06 12:43 AM.
#143430 24/02/06 12:42 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
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

#143431 24/02/06 12:43 AM
Joined: Feb 2006
Posts: 4
T
Self-satisified door
Offline
Self-satisified door
T
Joined: Feb 2006
Posts: 4
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

Last edited by TheXX; 24/02/06 12:44 AM.

Link Copied to Clipboard