Go Back   EQEmulator Home > EQEmulator Forums > General > General::Server Discussion

General::Server Discussion Discussion about emulator servers.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-15-2022, 11:00 AM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default Custom Slash Commands

I'd like to put a /hotzone slash command that lists the current hotzones for my players. Is there a data flow diagram or an example of making a custom command? Or is it even possible?
Reply With Quote
  #2  
Old 02-15-2022, 02:10 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

You are better off using # commands in perl or lua with custom global_player code

Code:
	if ($text=~/#cooldowns/i) {
		$client->ResetAllCastbarCooldowns();
		$client->Message(13, "ResetAllCastbarCooldowns!");
	}

Example to reset all castbar cooldowns in perl

If you are getting a weird "error command not found" set this rule to true

Code:
SELECT * FROM rule_values r WHERE r.rule_name LIKE "%SuppressCommandErrors%"
Reply With Quote
  #3  
Old 02-15-2022, 08:26 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Can anyone use # commands or do I need to somehow specify an accesslevel?
Reply With Quote
  #4  
Old 02-15-2022, 10:26 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Quote:
Originally Posted by markusdabrave View Post
Can anyone use # commands or do I need to somehow specify an accesslevel?
Just add code to restrict it to a certain Status which is a variable exported to client scripts

Code:
if ($status >= 200) { #CUSTOM GM ONLY COMMANDS
	if ($text=~/#cooldowns/i) {
		$client->ResetAllCastbarCooldowns();
		$client->Message(13, "ResetAllCastbarCooldowns!");
	} elsif ($text=~/#randomstuff/i) {
		#Do more things ect.. ect..
	}
}
If you need an API reference just use spire.

http://spire.akkadius.com/quest-api-explorer
Reply With Quote
  #5  
Old 02-16-2022, 02:17 AM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Thanks. Appreciate the help.
Reply With Quote
  #6  
Old 02-16-2022, 05:25 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Ok I'm feeling like a complete moron. I've #reloadquests and added the below code to my global_player.pl and it's still not working. I also enabled the error message suppressing suggested. What am I missing? Is # a special character?

Code:
# Hot Zone List - Lists Current Hotzones
sub EVENT_SAY {
        if ($text=~/#hotzone/i){
                $client->Message(315,'This is a test.');
        }
}
Reply With Quote
  #7  
Old 02-17-2022, 12:54 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,447
Default

You can also add slash commands by using dll injection, though it's a bit more involved.

This is how I did hooks on classless 3:

https://github.com/SecretsOTheP/clas...ndAPI.cpp#L511
Reply With Quote
  #8  
Old 02-18-2022, 03:00 AM
krauser1
Fire Beetle
 
Join Date: Sep 2006
Posts: 8
Default use event_command not event_say in global_player.pl or .lua

Quote:
Originally Posted by markusdabrave View Post
Ok I'm feeling like a complete moron. I've #reloadquests and added the below code to my global_player.pl and it's still not working. I also enabled the error message suppressing suggested. What am I missing? Is # a special character?

Code:
# Hot Zone List - Lists Current Hotzones
sub EVENT_SAY {
        if ($text=~/#hotzone/i){
                $client->Message(315,'This is a test.');
        }
}

https://docs.eqemu.io/quest-api/events/#example_14

these examples are a working template for adding your own commands.
Reply With Quote
  #9  
Old 02-18-2022, 08:03 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Thanks. Got it working. 99% of my problem was using nano to edit. Started using g komodo and found all sorts of syntaxes errors.
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 01:28 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