WoWBench/Getting started: Difference between revisions

No edit summary
 
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<small>[[WoWBench]] &raquo; Getting started</small>
{{tocright}}
{{tocright}}


= Starting WoWBench =
== Starting WoWBench ==
<div style="margin-left: 3%;">
<div style="margin-left: 3%;">


== Example startup ==
Getting up and running with WoWBench is really only a matter of starting it.
<div style="margin-left: 3%;">
 
=== Startup with [[AddOn Studio]]: ===
a. <code>View > Lua Console</code>
 
[[File:AddOn_Studio_2022_for_WoW_-_Features_Lua_Console_Menu_-_220412.0.png]]
 
b. <code>Lua Console > Choose shell... > Bench</code>
 
[[File:AddOn_Studio_2022_for_WoW_-_Features_Lua_Console_Bench_Button_-_220412.0.png]]
 
c. WoWBench loaded in AddOn Studio
 
[[File:AddOn_Studio_2022_for_WoW_-_Features_Lua_Console_Bench_Console_-_220412.0.png]]
 
Link for getting back to these docs can be found at the top of the Bench console log:


Getting up and running with WoWBench is really only a matter of starting it, e.g.:
[[File:AddOn Studio 2022 for WoW - Features Lua Console Bench Docs Link - 220412.1.png]]


:{{Code|C:\wowbench>'''lua wowbench.lua -f'''}}
=== Startup with the command line: ===
:<code>C:\wowbench>'''lua wowbench.lua -f'''</code>


The "-f" switch probably isn't what you want to use for each startup, but if you give ''no'' [[#Command line arguments|command line arguments]], it will show parameter help rather than starting up.
The "-f" switch probably isn't what you want to use for each startup, but if you give ''no'' [[#Command line arguments|command line arguments]], it will show parameter help rather than starting up.
Line 51: Line 64:
</div><div style="clear:left;"></div>
</div><div style="clear:left;"></div>


== Running ==
At this point, you have a vanilla WoW emulator up and running.  
At this point, you have a vanilla WoW emulator up and running.  


Line 89: Line 103:
  ''would produce help for the '''look''' command''
  ''would produce help for the '''look''' command''
</div><div style="clear:left;"></div>
</div><div style="clear:left;"></div>


</div>
</div>


== Command line arguments ==
=== Command line arguments ===
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


;Usage:{{code|lua50 wowbench.lua [<parameters>] addon1 [addon2 ...]}}
;Usage:<code>lua50 wowbench.lua [<parameters>] addon1 [addon2 ...]</code>


Parameters:
Parameters:
Line 110: Line 123:
</div>
</div>


== Loading AddOns ==
=== Loading AddOns ===
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Easy:
Easy:


:{{Code|lua50 wowbench.lua ct_raidassist ace archud}}
:<code>lua50 wowbench.lua ct_raidassist ace archud</code>




Line 126: Line 139:
</div>
</div>


= The WoWBench prompt =
== The WoWBench prompt ==
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 132: Line 145:


* Call functions in your AddOn directly from the prompt:
* Call functions in your AddOn directly from the prompt:
:: {{Code|MyAddOn_DoSomething("someParameter")}}
:: <code>MyAddOn_DoSomething("someParameter")</code>
* Make Alice, Bob or Charles (the default player characters) say something:  
* Make Alice, Bob or Charles (the default player characters) say something:  
:: {{Code|say Alice Help! Help! The horrible Murloc Warrior is hitting me!}}
:: <code>say Alice Help! Help! The horrible Murloc Warrior is hitting me!</code>
* Fire an event:  
* Fire an event:  
:: {{Code|fire DUEL_REQUESTED Charles}}
:: <code>fire DUEL_REQUESTED Charles</code>
* Run a slash command:  
* Run a slash command:  
:: {{Code|/myaddon dosomething}}
:: <code>/myaddon dosomething</code>
* Look at the frame that popped up:  
* Look at the frame that popped up:  
:: {{Code|look MyAddOnMainFrame}}
:: <code>look MyAddOnMainFrame</code>
* Click a button in it:  
* Click a button in it:  
:: {{Code|click MyAddOnMainFrameIWinButton}}
:: <code>click MyAddOnMainFrameIWinButton</code>


== How to interact with things ==
=== How to interact with things ===
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 150: Line 163:




=== Looking at the world ===
==== Looking at the world ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 177: Line 190:
</div>
</div>


=== Interacting with units and objects ===
==== Interacting with units and objects ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 190: Line 203:
</div><div style="clear:left;"></div>
</div><div style="clear:left;"></div>


This just a simple <tt>&lt;OnEnter&gt;</tt> trigger in world.xml, in {{code|&lt;Object name&#x3d;"Signpost"&gt;}}, which demonstrates that you can more or less define the world to behave exactly the way you like it to. A more meaningful implementation of OnEnter in objects is probably to trigger the GameTooltip object to show:
This just a simple <tt>&lt;OnEnter&gt;</tt> trigger in world.xml, in <code>&lt;Object name&#x3d;"Signpost"&gt;</code>, which demonstrates that you can more or less define the world to behave exactly the way you like it to. A more meaningful implementation of OnEnter in objects is probably to trigger the GameTooltip object to show:




Line 203: Line 216:
</div>
</div>


=== Looking at frames ===
==== Looking at frames ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 227: Line 240:




To see ''everything'' on-screen (well, nearly), you can {{code|look UIParent}}, but ''that'' dump, we're not going to show here :-)
To see ''everything'' on-screen (well, nearly), you can <code>look UIParent</code>, but ''that'' dump, we're not going to show here :-)




</div>
</div>


=== Summary of interaction commands ===
==== Summary of interaction commands ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">
{{infobox|'''Behind the scenes:''' Internally to WoWBench, a game-world object is just another UI object with event handlers.
{{Notebox|'''Behind the scenes:''' Internally to WoWBench, a game-world object is just another UI object with event handlers.
* The classes representing game-world objects emulate game engine behavior when receiving events.
* The classes representing game-world objects emulate game engine behavior when receiving events.
* Game-world objects are defined in world.xml and world.lua.}}
* Game-world objects are defined in world.xml and world.lua.}}
Line 247: Line 260:
</div>
</div>


== More commands ==
=== More commands ===
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


=== Firing events ===
==== Firing events ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 294: Line 307:
</div>
</div>


=== Logging in multiple players ===
==== Logging in multiple players ====
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 331: Line 344:
</div>
</div>


= How to use the built-in debugger =
== How to use the built-in debugger ==
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">


Line 341: Line 354:
</div>
</div>


= More =
== More ==
<div style="margin: 0 0 1em 2%;">
<div style="margin: 0 0 1em 2%;">