View Single Post
  #1  
Old 07-20-2015, 12:24 PM
Osiris.Envy's Avatar
Osiris.Envy
Fire Beetle
 
Join Date: Jun 2015
Location: California
Posts: 5
Default Simple Lua Concatenation

How can I concatenate a charid into a Lua string? (I'll use a simple example to illustrate my question)


The following Lua script works great to output "NPC says, Osiris_rueda_status"

Code:
function event_say(e)
	if (e.message:findi("hail")) then 
		e.self:Say("" .. e.other:GetName() .."_rueda_status");	
	end
end
How can I get the Lua output to use the charid and not the char name?

The desired output would be, "NPC says, 147_rueda_status" (where 147 is the id from the character_data table)

I can do this with Perl

Code:
sub EVENT_SAY {

if ($text=~/hail/i){
$client->Message($TextColor, " ");
		plugin::Whisper($charid.'_rueda_status');
	}
}
However, for what I want to accomplish I need the desired output to come from a Lua script


Thanks,

Osiris
Reply With Quote