Need help with Click script (Using SecureActionButtonTemplate) menu

User Tag List

Results 1 to 7 of 7
  1. #1
    ATscripts's Avatar Private
    Reputation
    5
    Join Date
    Jun 2014
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with Click script (Using SecureActionButtonTemplate)

    My problem is quite simple. I've generated 40 click macros for different abilities / targets. Now I need to be able to use them all with single click.

    How do I generate click for clicking all those 40 click buttons?

    To be specific, syntax I use is /click "AbilityTarget" and buttons are generated via SecureActionButtonTemplate. '

    I figured as much to use table to store the click buttons but onwards I am clueless.

    Need help with Click script (Using SecureActionButtonTemplate)
  2. #2
    InternetExplorer's Avatar Contributor
    Reputation
    136
    Join Date
    Sep 2007
    Posts
    420
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried looping them? Needs a lua unlocker tho
    for _,btn in pairs(buttons) do
    btn:Click('LeftButton',1)
    end

  3. #3
    ProbablyEngine's Avatar Contributor Lead ProbablyEngine Dev CoreCoins Purchaser
    Reputation
    160
    Join Date
    Mar 2008
    Posts
    64
    Thanks G/R
    0/0
    Trade Feedback
    1 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You cannot click more than one button with a single hardware action, this is a security limitation set by Blizzard.

    How do you click the generated buttons? Thats easy and its set by the name given to the button frame (bolded in this example).

    button = CreateFrame("Button", "UniqueButtonName", UIParent, "SecureActionButtonTemplate");
    button:SetAttribute("type", "spell")
    button:SetAttribute("spell", "Charge")
    button:SetAttribute("target", "target")


    To access this button via a /click macro, you'd use the UniqueButtonName.

    /click UniqueButtonName

  4. #4
    ATscripts's Avatar Private
    Reputation
    5
    Join Date
    Jun 2014
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help, managed to solve the issue.

    Now I only minor issue left. I use;

    local CastButton = getglobal(SA_Stringer('ref_'..NoSpaceAbility..'_'..target)) or CreateFrame("Button",SA_Stringer('ref_'..NoSpaceAbility..'_'..target),nil,"Secur eActionButtonTemplate")

    to generate buttons (copy pasted from SDM). Buttons I generate are "wrapped" in string, to say. eg. /click "thisisbutton" instead of /click thisisbutton.

    How do I get /click thisisbutton?

    If this one clarifies anything;

    function SA_Stringer(var) --converts a variable to a string for purposes of putting it in a string for RunScript(). Strings are formatted as quoted strings, other vars are converted to strings.
    if type(var)=="string" then
    return string.format("%q", var)
    else
    return tostring(var)
    end
    end

  5. #5
    bone91's Avatar Sergeant Major
    Reputation
    91
    Join Date
    Feb 2008
    Posts
    156
    Thanks G/R
    17/9
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you trying to script without a Lua unlocker? It's pretty much impossible (I'm saying pretty much, because it might be, but not as far as I know).
    You can not use a variable name in a macro. It's just not possible. You can change a macro's content, but only out of combat. Which probably defies what you want to do.

    I was playin around with this on TBC a while ago and I found that if you're using Object:Click() from within a macro on default-interface button, there seems to be no restriction. I found this when looking at this script:
    /run LoadAddOn"Blizzard_TrainerUI" f=ClassTrainerTrainButton f.e = 0 if f:GetScript"OnUpdate" then f:SetScript("OnUpdate", nil)else f:SetScript("OnUpdate", function(f,e) f.e=f.e+e if f.e>.01 then f.e=0 f:Click() end end)end
    I then found, that even when using /click Name on a button that I created myself, I would get the "protected" warning. However, if I called /run SetBinding("NONE"), opened the keybinding menu and closed it again (after creating the button), it would work flawlessly. If this still works in 3.3.5, you could ActionButtons or UnitButtons and preset their action to e.g. cast SW, then click them if you read Scatter/Blind/Poly from the combatlog or UnitCastingInfo() etc.

    I hope that helped. Since I'm not really understanding your question and I think you're moving in the wrong direction anyway.

  6. #6
    ATscripts's Avatar Private
    Reputation
    5
    Join Date
    Jun 2014
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SDM generates buttons that you can click eg /click rdf_Button

    and I can run scripts without lua unlocker with button system that's why I'm making it heh.

  7. #7
    Vitahero's Avatar Member
    Reputation
    1
    Join Date
    Apr 2023
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there any way to make this work? How does addons like Gnome Sequencer achieve 1 button rotations with basic logic? Object:Click() does not work for me in 3.3.5(old client). Maybe there is some way to rebind the button to different spell while in combat?

    Edit:
    Even inserting text into the edit box from macro, then pressing enter trigger a macro script blocked message.
    Last edited by Vitahero; 04-22-2023 at 10:49 PM.

Similar Threads

  1. [Lua Script] Need help with 2 Scripts (One Boss, One Gauntlet)
    By controlsx2 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2010, 02:42 AM
  2. Need help with Lua script
    By Pieterkii in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 03-04-2010, 07:07 AM
  3. need help with npc script
    By bitty in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-16-2008, 06:21 AM
  4. Need help with my script [lua]
    By Satzen in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 05:19 PM
  5. [C++]Need help with my Scripted Item
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-13-2008, 05:55 PM
All times are GMT -5. The time now is 09:31 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search