• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new anncouncement concering the upcoming addition to Stratics. You can find the annoucnement Here!

Conditional Statement to Detect Mounted State

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I'm wondering if it is possible with a command line script to set actions based on whether you are mounted or not? The problem is that if you are mounted, and you give the all kill command to a loose pet, the pet you are mounted on will refuse the command and lose loyalty.

What I want is a conditional statement that will say "[pet name] kill" if I am mounted and "all kill" if I am not. It seems to me that this would be possible, I just don't know how to do it.
 

petemage

Babbling Loonie
Stratics Veteran
UNLEASHED
I'm wondering if it is possible with a command line script to set actions based on whether you are mounted or not? The problem is that if you are mounted, and you give the all kill command to a loose pet, the pet you are mounted on will refuse the command and lose loyalty.

What I want is a conditional statement that will say "[pet name] kill" if I am mounted and "all kill" if I am not. It seems to me that this would be possible, I just don't know how to do it.
Code:
script if WindowData.MountedObjId > 0 then SendChat(nil, L"/say puppy kill") else SendChat(nil, L"/say all kill") end
Script commands are limited to 128 characters in length by default. The thing above is 117 chars in length, so there is quite a bit more space for alternative pet names than "puppy" :p

If it gets more complex, you have to put it in a mod.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I will have to try that out. Thank you! I had a valuable pet go wild on me because I was giving kill commands to a pet while I was mounted.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
Ok if you are using Pinco's UI, the script needs to go as follows:
Code:
script if IsRiding() then SendChat(nil, L"/say Dumbo kill") else SendChat(nil, L"/say all kill") end
edit: Now I need to know if there is a way I can change the "/say" to a whisper.

In Pinco's UI if you want to use a whisper, emote or yell in a command line script the syntax is as follows:

Send chat to active chat window:
Code:
SendChat(nil, L"Hello World!")
Say:
Code:
SendChat(nil, L"/say Hello World!")
Emote:
Code:
SendChat(nil, L":Hello World!")
Whisper:
Code:
SendChat(nil, L";Hello World!")
Yell:
Code:
SendChat(nil, L"!Hello World!")
 
Last edited:

petemage

Babbling Loonie
Stratics Veteran
UNLEASHED
Ok if you are using Pinco's UI, the script needs to go as follows:
Code:
script if IsRiding() then SendChat(nil, L"/say Suti kill") else SendChat(nil, L"/say all kill") end
Now I need to know if there is a way I can change the "/say" to a whisper.
It's supposed to be "/tell" or "/w" according to the ChatSettings.lua. However I couldn't make it work. I think it's something like "/tell <name> <message>" but I guess it would need some more testing with two players.

Nevermind what I wrote earlier about it.

Code:
	ChatSettings.Channels[ SystemData.ChatLogFilters.SAY ]		   = ChatChannel( L"Say",			SystemData.ChatLogFilters.SAY,				"Chat",	 false,		  true,				false,		ChannelColor(215, 215, 1),	  SystemData.ChatLogFilters.SAY,		  L"/say" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.WHISPER ]	   = ChatChannel( L"Whisper",		SystemData.ChatLogFilters.WHISPER,			"Chat",	 false,		  true,				false,		ChannelColor(215, 215, 1),	  SystemData.ChatLogFilters.WHISPER,	  L"/tell" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.PARTY ]		 = ChatChannel( L"Party",		  SystemData.ChatLogFilters.PARTY,			  "Chat",	 true,		   true,				false,		ChannelColor(56, 191, 40),	  SystemData.ChatLogFilters.PARTY,		L"/party" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.GUILD ]		 = ChatChannel( L"Guild",		  SystemData.ChatLogFilters.GUILD,			  "Chat",	 true,		   true,				false,		ChannelColor(96, 231, 0),	   SystemData.ChatLogFilters.GUILD,		L"/guild" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.ALLIANCE ]	  = ChatChannel( L"Alliance",	   SystemData.ChatLogFilters.ALLIANCE,		   "Chat",	 true,		   true,				false,		ChannelColor(48, 215, 231),	 SystemData.ChatLogFilters.ALLIANCE,	 L"/alliance" )	
	ChatSettings.Channels[ SystemData.ChatLogFilters.EMOTE ]		 = ChatChannel( L"Emote",		  SystemData.ChatLogFilters.EMOTE,			  "Chat",	 false,		  true,				false,		ChannelColor(215, 215, 1),	  SystemData.ChatLogFilters.EMOTE,		L"/emote" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.YELL ]		  = ChatChannel( L"Yell",		   SystemData.ChatLogFilters.YELL,			   "Chat",	 false,		  true,				false,		ChannelColor(215, 215, 1),	  SystemData.ChatLogFilters.YELL,		 L"/yell" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.SYSTEM ]		= ChatChannel( L"System",		 SystemData.ChatLogFilters.SYSTEM,			 "Chat",	 true,		   true,				true,		ChannelColor(255, 255, 255) )	
	ChatSettings.Channels[ SystemData.ChatLogFilters.PRIVATE ]	   = ChatChannel( L"Private",		SystemData.ChatLogFilters.PRIVATE,			"Chat",	 true,		   true,				false,		ChannelColor(207, 56, 223) )
	ChatSettings.Channels[ SystemData.ChatLogFilters.CUSTOM ]		= ChatChannel( L"Chat (Global)",  SystemData.ChatLogFilters.CUSTOM,			 "Chat",	 true,		   true,				false,		ChannelColor(75, 120, 230),	 SystemData.ChatLogFilters.CUSTOM,	   L"/chat" )
	ChatSettings.Channels[ SystemData.ChatLogFilters.GESTURE ]	   = ChatChannel( L"Gesture",		SystemData.ChatLogFilters.GESTURE,			"Chat",	 true,		   true,				false,		ChannelColor(215, 215, 1) )
	ChatSettings.Channels[ SystemData.ChatLogFilters.GM ]			= ChatChannel( L"GM",			   SystemData.ChatLogFilters.GM,				 "Chat",	 true,		   true,				true,			ChannelColor(232, 48, 88),	  SystemData.ChatLogFilters.GM,		   L"/gm" )
(scroll to the right to see the channel commands)
 
Last edited:

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
Pinco found a work around, but I think it's a little complicated and might not work in a command line script. I'm going to take a look at his code again and see if I can figure out how to incorporate it into that line.
 

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
In Pinco's UI if you want to use a whisper, emote or yell in a command line script the syntax is as follows:

Send chat to active chat window:
Code:
SendChat(nil, L"Hello World!")
Say:
Code:
SendChat(nil, L"/say Hello World!")
Emote:
Code:
SendChat(nil, L":Hello World!")
Whisper:
Code:
SendChat(nil, L";Hello World!")
Yell:
Code:
SendChat(nil, L"!Hello World!")
This may also work in the default UI but I'm not going to reload the default UI to test it. Perhaps someone else can.
 
Last edited:

Llewen

Grand Inquisitor
Stratics Veteran
Stratics Legend
Campaign Supporter
I will edit my post, but there is one correction if you use the following:
Code:
SendChat(nil, L"Hello World!")
It will send the message to whatever chat window you have open. If you want to "say" in game, you have to use the following:
Code:
SendChat(nil, L"/say Hello World!")
 
Top