Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-09-2013, 07:40 PM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default Which is a better script format?

I am trying to convert to lua but finding that I always go back to what "works" with perl. I have a custom check in my global_player that checks if a character has a certain list of items when zoning, and removes them if true.

Which of these would be more efficient, assuming that the list will be much larger in size?

Perl
Code:
sub EVENT_ENTERZONE
{
	my @meats1 = qw(1001 1002 1003);
	for ($j = 0; $j < 3; $j++) {
		if(plugin::check_hasitem($client, $meats1[$j])) {
			quest::collectitems($meats1[$j], 1);	
		}
	}
}
Lua
Code:
function event_enter_zone(e)
	local meats1 = {1001, 1002, 1003}; -- temp using cloth items to test with
	for j, name in ipairs(meats1) do
		if(e.self:HasItem(name) == true) then
			eq.collect_items(name, true);
		end			
  	end
end
The reason I ask is that if Lua is much more efficient I will try to focus on lua, but there seems to be more things I can do with perl, but most likely is my experience with lua, or lack of.

Also, are those two methods the best way to iterate through the lists?
Reply With Quote
 


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 12:57 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