mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2016
Posts: 2
Z
Zephram Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Aug 2016
Posts: 2
How do you get /write to perform an operation like -ds on a multi-word string like $3-? I'm trying to make a 'give' command to let users give items from their inventories to one another, and it only works with items that have one-word names and no spaces.

"give user charmstone" will take 'charmstone' out of $nick.txt and put it in user.txt as expected. However, "give user -6 readin' glasses" will give user.txt the -6 readin' glasses, but won't delete the original item from $nick.txt.

I've tried every possible way of setting up /write that I can think of - enclosing it in $+(), quotes, and even using vars to recombine $3 $4 $5..., but simply can't get /write to work with multi-word strings.

write inv $+ $2 $+ .txt $3-
write $+(-dw,"$3-") inv $+ $nick $+ .txt

^ What's wrong with it? First line works fine, second one never handles anything with spaces, even though the helpfile claims "" will handle them...

Cheers smile

Last edited by Zephram; 15/08/16 12:39 AM.
Joined: May 2015
Posts: 249
Fjord artisan
Offline
Fjord artisan
Joined: May 2015
Posts: 249
$+(-dw,",$3-,") or $+(-dw",$3-,")


Dont give a fish - teach to fish!
Joined: Aug 2016
Posts: 2
Z
Zephram Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Aug 2016
Posts: 2
That first one worked flawlessly, thank you! Now I can avoid using .ini for inventories - useful since they need to be encoded UCS-2LE.

Cheers!


Link Copied to Clipboard