Hi all,
Brrrr..... little problem, there....
Using > dostring(arg.."="..val) <
we can assign a value(val) to a parameter (arg),...
But,...
If we want that parameter get the ' nil value ' (to disable the parameter),, then... how can we get the nil result ???
I've tried:
---
val = nil
dostring(arg.."="..val)
---
doesn't work, lol... ^^
Thks in adance for your help... :)
l8tr,, ;)
if you mean send to user the value equals nil use brackets val = "nil"
otherwise i dont understand what you mean ?(
Hi there,,
well,.. it was to assign a nil value on a parameter/string,... :)
We have speak about on Msn,... but I take an example to be more clear,...
---
!set beertime on
---
then, if you use the function:
---
if arg2 == "on" then val = 1 end
dostring(arg.."="..val)
---
it gives:
"beertime" = 1
---
But i would like a way to assign a nil value to arg,... instead of using such function as:
---
if arg == "beertime" and arg2 == "off" then"beertime" = nil end
---
hope it's more clear...
l8tr,, ;)
dunno maybe
dostring(arg.."=nil)
but else it clear that the error comes up, cause LUA will look for the variable val, and if you set a variable = nil then it is release = deleted, nada, nirvana what ever, its not there anymore.
The same way to do proper debugging.
Use: or "nil"
dostring(arg.."="..(val or "nil"));
if val is equal to nil the or condition kicks in and the non-nil string "nil" is returned in its place. This is very usefull when you want to test values/commands in scripts.
SendToAll(sBotName, val or "nil");
P.S. - I reread your comment and you appear to be using strings. Don't forget to do formating with the val that you are passing (make sure they are sending you some cooked data).
-NotRabidWombat