• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

Game Master Addon

Gurky

Authorized
Joined
Mar 28, 2015
Everything is now basically finished.


Main Screen

The Name Buttons to the Left Light up Green for online, Yellow for pending or offline, Grey for answered. In the Middle of the window it alerts that the ticket has been answered by a GM and how.
2pkLbYF.png


Mail
XaTQDP0.png


Notes
bVoiOHj.png


Teleports
l3ZrXxA.png


Learn (Only works on the GM)(for our test team)
tLVhQQS.png


Jokes
3jhyySJ.png

Auras
LAo2IJb.png

Ban, Mute, Kick! OH NO!
wsEr4bX.png

Ban Confirm
pkiQmv3.png


Ticket Answered Alert

Anything done via the addon is reported to all GM's via the chat window.
7py7MFZ.png
 
Last edited:
Re: Looking for Advice

Hi, it's been a long time so i may be mistaken but i think you can use TargetByName("name_of_targer")
 
Re: Looking for Advice

Hi, how about this? http://wowwiki.wikia.com/wiki/API_TargetUnit
Code:
TargetUnit("Player")
SendChatMessage(gmCommands["weapon skill"])
...
It could work on 1.12.1. (http://www.wow-one.com/forum/topic/11085-rogue-macros/)


Updated Code

Code:
gmCommands["axes"] = ".learn 196"
gmCommands["axestwo"] = ".learn 197"
gmCommands["maces"] = ".learn 198"
gmCommands["macestwo"] = ".learn 199"
gmCommands["polearms"] = ".learn 200"
gmCommands["swords"] = ".learn 201"
gmCommands["swordstwo"] = ".learn 202"
gmCommands["unarmed"] = ".learn 203"
gmCommands["defense"] = ".learn 204"
gmCommands["staves"] = ".learn 227"
gmCommands["bows"] = ".learn 264"
gmCommands["guns"] = ".learn 266"
gmCommands["daggers"] = ".learn 1180"
gmCommands["Thrown"] = ".learn 2567"
gmCommands["wands"] = ".learn 5009"
gmCommands["crossbows"] = ".learn 5011"
gmCommands["fistweapons"] = ".learn 15590"


function btnGmWeap_OnClick()
    TargetUnit("player")
    SendChatMessage(gmCommands["axes"])
    SendChatMessage(gmCommands["axestwo"])
    SendChatMessage(gmCommands["maces"])
    SendChatMessage(gmCommands["macestwo"])
    SendChatMessage(gmCommands["polearms"])
    SendChatMessage(gmCommands["swords"])
    SendChatMessage(gmCommands["swordstwo"])
    SendChatMessage(gmCommands["unarmed"])
    SendChatMessage(gmCommands["defense"])
    SendChatMessage(gmCommands["staves"])
    SendChatMessage(gmCommands["bows"])
    SendChatMessage(gmCommands["guns"])
    SendChatMessage(gmCommands["daggers"])
    SendChatMessage(gmCommands["Thrown"])
    SendChatMessage(gmCommands["wands"])
    SendChatMessage(gmCommands["crossbows"])
    SendChatMessage(gmCommands["fistweapons"])
    
end


This Almost works as I would like it. However Now it does the following..


*Targets Me*
Casts Commands on my Target Prior to me.

If I use it again obviously it casts all the commands on me due to me already being targeted.
So I feel there needs to be some sort of pause between the target and the commands.
 
Last edited:
Re: Looking for Advice

Ok Well I have got this now
However, Now I have to click the button twice. I want it to work with one click
Code:
    TargetUnit("player")
if ( UnitIsUnit("target", "player") ) then  
    SendChatMessage(gmCommands["axes"])
    SendChatMessage(gmCommands["axestwo"])
    SendChatMessage(gmCommands["maces"])
    SendChatMessage(gmCommands["macestwo"])
    SendChatMessage(gmCommands["polearms"])
    SendChatMessage(gmCommands["swords"])
    SendChatMessage(gmCommands["swordstwo"])
    SendChatMessage(gmCommands["unarmed"])
    SendChatMessage(gmCommands["defense"])
    SendChatMessage(gmCommands["staves"])
    SendChatMessage(gmCommands["bows"])
    SendChatMessage(gmCommands["guns"])
    SendChatMessage(gmCommands["daggers"])
    SendChatMessage(gmCommands["Thrown"])
    SendChatMessage(gmCommands["wands"])
    SendChatMessage(gmCommands["crossbows"])
    SendChatMessage(gmCommands["fistweapons"])
    end
end
 
Re: Looking for Advice

Does it work in a macro?
/target Gurky
.learn ???

Edit: Had a quick thought
Something is weird with the gm command API, so it is not the luas fault. What if you clear the target, target yourself, clear it again and target yourself again. Shouldnt that refresh the buffer of the gm command API or sth. I mean it is worth a try.
 
Last edited:
Re: Looking for Advice

Does it work in a macro?
/target Gurky
.learn ???

Edit: Had a quick thought
Something is weird with the gm command API, so it is not the luas fault. What if you clear the target, target yourself, clear it again and target yourself again. Shouldnt that refresh the buffer of the gm command API or sth. I mean it is worth a try.

Same issue as before with it adding the spells to the Target prior to hitting the button


As for putting in the macro
it will type /target gurky in chat instead of targeting me.
 
Re: Looking for Advice

Although the macro should work just fine, I came up with this for "timed" tasks:

Code:
-- Ingame: /run a()
function a() 
    delaySec = 0.9 -- Set your desired delay in seconds
    
    -- Your code here
    TargetUnit("player")
    
    timeElapsed = 0
    waitFrame = CreateFrame("Frame","WaitFrame", UIParent);
    waitFrame:SetScript("onUpdate",function ()
        timeElapsed = timeElapsed + arg1
        if timeElapsed > delaySec then

            -- Your delayed code here
            DEFAULT_CHAT_FRAME:AddMessage("Target is: "..UnitName("player"))
            
            waitFrame:SetScript("onUpdate",nil) -- Remove handler
        end
        end);
    end
Based on: http://wowwiki.wikia.com/wiki/USERAPI_wait
 
Re: Looking for Advice

Problem is TargetUnit function returns immediatelly but it takes some time to actually change the playertarget unit variable.

Code:
/run TargetUnit("player") -- targets you but "playertarget" variable is still your previous target
/run print(UnitName("target")) -- prints your name (note you need a print function declared)
/run print(UnitName("playertarget")) -- prints name of your previous target
/run CastSpellByName("Flash of Light") -- uses target information
/run SendChatMessage("") -- uses playertarget and send request to server
/run TargetUnit("playertarget")  -- restore your previous target because of a delay

So you need to delay your commands as well.

Code:
a1 = a1 or {196,197,198,199,200,201,202,203,204,227,264,266,1180,2567,5009,5011,15590}
a2 = a2 or CreateFrame("Frame");
SLASH_LRN1,SlashCmdList["LRN"] = "/lrn",function() 
    TargetUnit("player");
    a2:SetScript("OnUpdate", function()
        if not UnitIsUnit("playertarget", "target") then return end
        for _,v in pairs(a1) do
            SendChatMessage(".learn "..v)
        end
        a2:SetScript("OnUpdate", nil)
    end)
end
 
Last edited:
Re: Looking for Advice

Now I understand better what you are trying to do. To be honest, I am a bit surprised that SendChatMessage(...) would work at all, under any circumstances, given that it's basically a "/say". There ought to be another way of executing the commands, one that specifically includes a target as a parameter. As I said, I have zero experience with the dot commands, but is that really how they work (using a hidden "playertarget" parameter)? That's a strange design.
 
Re: Looking for Advice

I think that slash command "/say" just uses the SendChatMessage(...) function.
And GM (dot) commands are processed by the server core, for example in Trinity core there is a command ".cast self" which could be used in this situation. There really isn't some special way to write gm commands.
 
Re: Looking for Advice

But the one in your example is kind of weird. I would expect that such commands would work something like this:
Code:
.learn 202 target="Gurky"
and not by having to actually target the player Gurky and then type ".learn 202". If there's no way to pass the target as a parameter of some command, then you might have to use the delay kludge (what Flynn said) and here I would be generous and put something like one second delay, just in case.

I also would expect that some equivalent of ConsoleExec(...) would exist for these commands, rather than SendChatMessage(...). I find this very strange.

I wish I could be more helpful.
 
Last edited:
Re: Looking for Advice

You have to target. Some commands like .send mail allow you to enter a player name but .learn with no target auto targets you

- - - Updated - - -

also .learn is not a console command. It is a chat command
 
Re: Looking for Advice

(New post, so you don't miss it.)

I may have been too focused on the command itself. How about this instead:
On load, you check if UnitIsUnit("target","player") and if Not, you disable, by default, all buttons that need the correct target. You make and enable a single button, called TargetSelf or smth. Pressing this button executes TargetUnit("player"). Then you register event PLAYER_TARGET_CHANGED and the handler function that is called on this event checks if UnitIsUnit("target","player") holds. If it does, the handler enables all the buttons and if it does not, it disables them. Maybe this will do what you want? And maybe it will not suffer from the delay problem.

If the default when there is no target is yourself, then maybe you can account for that too and enable the buttons if there's no target at all. Not sure if that would work around the delay and it can also be a bit tricky (check this: http://wowprogramming.com/forums/development/527)
 
Re: Looking for Advice

That's not quite what I understood. I don't think the problem generalizes to "press button X that will target player Y end execute code Z". In general, you have to target manually, right? (unless you want buttons like "target party member 2 and execute X") And then, I would hope, enough time would pass between your manual targeting and dragging the mouse pointer to the button and clicking it. Disabling the buttons adds extra time and extra precaution.

From what I understood, he's sure that the target should be "player" in those cases and that's why the code is "target self, execute X" and not, say, one button for "target self" and another for "execute x", which would work just as well, no?
 
Re: Looking for Advice

I want it to auto target myself or the gm using it so it doesn't get cast on a player
 
Any safeguard on the ban button like when you have to type delete to delete an item? A missclick would be so easy to happen :p

What about an invisible aura for the GM on the spells? Only self-cast.
 
Top Bottom