Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::LUA

Quests::LUA Section regarding LUA scripts, help, questions, answers

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 07-20-2015, 02:47 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Code:
e.self:Say("" .. e.other:CharacterID() .."_rueda_status");

You just want character ID?


You can get more lua info here as well.

https://github.com/EQEmu/Server/wiki/Lua-Parser

http://wiki.eqemulator.org/p?Lua_Parser&frm=Main

Last edited by NatedogEZ; 07-20-2015 at 02:52 PM..
Reply With Quote
  #3  
Old 07-20-2015, 04:53 PM
demonstar55
Demi-God
 
Join Date: Apr 2008
Location: MA
Posts: 1,164
Default

Code:
e.self:Say(tostring(e.other:CharacterID()) .. "_rueda_status")
That should work.
Reply With Quote
  #4  
Old 07-22-2015, 01:49 AM
Osiris.Envy's Avatar
Osiris.Envy
Fire Beetle
 
Join Date: Jun 2015
Location: California
Posts: 5
Default

thx for the replies - I am now getting the desired output
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:47 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3