Need Some Help

Posted by Aduka on Thu 30 Jul 2009 10:49 PM — 6 posts, 23,999 views.

#0
I'm attempting to make an alias that when typed will report the data this below locals each time. I already have it running in a note, but I'm not sure of the command to send messages to the world. Like Note put it to the output, what is the command to put it into say the world itself.

^Your .* \[(\d+)\]$

function TotalDmg

local Dmg
local TotalDmg

Dmg = %1

TotalDmg = tonumber (GetVariable("Total_Damage"))

if TotalDmg == nil then

local FinalDmg

FinalDmg = 0 + Dmg

SetVariable ("Total_Damage", FinalDmg)

else

local FinalDmg

FinalDmg = TotalDmg + Dmg

SetVariable ("Total_Damage", FinalDmg)

end
#1
Note/ColourNote will send a given string to the output of the world. Is that what you wanted to do, or not?

Cheers.
Australia Forum Administrator #2
Do you mean, to send back to the MUD? Like, you are telling others in your group your stats? In that case, Send.

http://www.gammon.com.au/scripts/function.php?name=Send
#3
I want the command that would allow me to send it like this

Tell Charneus This This This

Now if I entered that into the prompt on the screen it would send it as a command, and send charneus a message stating this this this, how would I do that from a script.

I use Colournote for my output.
#4
What am I doing wrong?

Error:

Run-time error
World: Aardwolf
Immediate execution
[string "Alias: "]:1: attempt to concatenate global 'Charneus' (a nil value)
stack traceback:
[string "Alias: "]:1: in main chunk

Alias:

ReportDmg * *

Script:

Send(%1.." "..%2.." ".."@WT@wotal @WD@wamage @WD@wealt as of @R:@w "..os.date().. " @R:@y "..GetVariable( "Total_Damage" ).."@R.@W")

@ = A color code.
Amended on Thu 30 Jul 2009 11:56 PM by Aduka
Australia Forum Administrator #5
It has replaced %1 by Charneus, so you have:


Send(Charneus .. " " .. whatever .." " .. blah blah


Charneus is a variable, which will be nil. You need to quote it:


Send ("Tell %1 " .. whatever