View source
From Iris2
for
Macros
Jump to:
navigation
,
search
=== quickstart === since iris doesn't have a nice editor dialog for hotkeys and macros yet, they have to be set up by editing config/mymacros.lua a few examples : SetMacro("f6", function() MacroCmd_Item_UseByName("bandage") MacroCmd_TargetSelf() end) SetMacro("ctrl+h", function() MacroCmd_Spell("Heal") end) SetMacro("shift+alt+s", function() MacroCmd_Skill("Spirit Speak") end) === about === <p>there is macro support in iris, but it is a bit different from the uo macro system. </p><p>there is no ingame editor dialog for it, you have to edit a textfile : <b>config/mymacros.lua</b> </p><p>you can use the macro system to assign hotkeys to toggle dialogs (paperdoll,backpack..) , assign hotkeys for skills, spells and items, and several other actions as well. </p><p>macros can be mapped to all sorts of keys, including numbers and function keys </p><p>you can specify modifyers, but currently if you use more than one, they have to be in that order : shift+alt+ctrl+f </p><p>you can assign macros like this : </p> <h2> <span class="mw-headline"> example </span></h2> <pre>SetMacro("ctrl+s",function() MacroCmd_Open("Status") end) -- Open Status window SetMacro("alt+c",function() MacroCmd_ToggleWarmode() end) -- Toggle between War/Peace modes SetMacro("alt+p",function() MacroCmd_Open("Paperdoll") end) -- Open Character Window SetMacro("alt+k",function() MacroCmd_Open("Skill") end) -- Open Skills SetMacro("alt+j",function() MacroCmd_Open("Journal") end) -- Open Journal SetMacro("alt+i",function() MacroCmd_Open("Backpack") end) -- Open Backpack SetMacro("alt+x",function() MacroCmd_Quit() end) -- Quit game SetMacro("alt+b",function() MacroCmd_Say("*bow*") end) -- Bow SetMacro("alt+s",function() MacroCmd_Say("*salute*") end) -- Salute </pre> <h2> <span class="mw-headline"> keynames </span></h2> <pre>a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, 0,1,2,3,4,5,6,7,8,9, f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15, mouse1,mouse2,mouse3,mouse4,mouse5,wheelup,wheeldown, backspace,tab,stopclear,return,np_enter,pause,capslock,escape,space, pgup,pgdn,end,home,left,up,right,down,screen,ins,del, lwin,rwin,menu, np0,np1,np2,np3,np4,np5,np6,np7,np8,np9,npmult,npadd,npsub,npkomma,npdiv, numlock,scroll,ue,plus,komma,minus,point,grid,oe,bslash,console,accent,ae,greater, NOT RECOMMENDED, but might work too: lshift,lcontrol,lalt,rshift,rcontrol,ralt </pre> <h2> <span class="mw-headline"> commands </span></h2> <pre>MacroCmd_Say (text) -- chat-text, example : MacroCmd_Say("hi all") MacroCmd_Quit () -- quits the game MacroCmd_NextCamMode () -- change cam mode MacroCmd_RepeatLastChat () -- repeat last chat-text MacroCmd_RepeatLastDoubleClick () -- repeat double click on last object MacroCmd_SelectNearestMobile () -- MacroCmd_SelectNextMobile () -- cycle through mobiles MacroCmd_AttackSelectedMobile () -- (26.11.2007 : currently broken, only runs to target, but doesn't attack) MacroCmd_ToggleWarmode () -- switch between war and peace mode MacroCmd_Open (dialogtype) -- open dialog, -- dialogtype can be one of Status,Skill,Journal,Backpack,Paperdoll,Compass -- example : MacroCmd_Open("Journal") MacroCmd_Skill (skillname) -- aktivate skill, see below for list MacroCmd_Spell (spellname) -- casts a spell, see below for list MacroCmd_ZoomCompass (zoomfactor) MacroCmd_ActivateNextRenderer () -- switch between 2d and 3d renderer... currently broken MacroCmd_CamChangeZoom (zoomadd) MacroCmd_Screenshot () MacroCmd_GridScreenshot () -- make high-resolution screenshot (multiple times the screensize) MacroCmd_WalkToMouse () -- currently broken MacroCmd_ShowFallBackTool () -- dev tool for fallback-gfx MacroCmd_ShowDevTool () -- dev tool MacroCmd_ItemSlot_Set (slotnumber) -- marks the item under the mouse for later usage MacroCmd_ItemSlot_Use (slotnumber) -- use item in slot MacroCmd_TargetLast () -- wait for target cursor and target the same thing that was targetted last time MacroCmd_TargetSelf () -- targets self MacroCmd_Item_UseByName (itemnamepart) -- uses the first item in the backpack that contains "itemnamepart" in it's name (useful for bandages and potions) </pre> <h2> <span class="mw-headline"> spell- and skill-hotkeys </span></h2> <pre>SetMacro("ctrl+h", function() MacroCmd_Spell("Heal") end) SetMacro("shift+alt+s", function() MacroCmd_Skill("Spirit Speak") end) </pre> <p><br> </p> <h3> <span class="mw-headline"> skillnames </span></h3> <p>Inscription, Veterinary, Animal Taming, Detecting Hidden, Fencing, Hiding, Animal Lore, Mace Fighting, Carpentry, Tailoring, Swordsmanship, Fishing, Spellweaving, Lumberjacking, Bushido, Chivalry, Provocation, Focus, Musicianship, Necromancy, Stealth, Bowcraft/Fletching, Poisoning, Remove Trap, Tactics, Spirit Speak, Mining, Ninjitsu, Wrestling, Snooping, Magery, Cooking, Cartography, Forensic Evaluation, Stealing, Tracking, Tinkering, Taste Identification, Meditation, Evaluate Intelligence, Blacksmithing, Discordance, Herding, Alchemy, Healing, Parrying, Camping, Resisting Spells, Anatomy, Peacemaking, Begging, Archery, Arms Lore, Lockpicking, Item Identification </p> <h3> <span class="mw-headline"> spellnames </span></h3> <p>Holy Light, Summ.Creature, Reveal, Curse, Polymorph, Arch Protection, Noble Sacrifice, Wall of Stone, Paralyze Field, Strength, Energy Bolt, Cunning, Mana Vampire, Mark, Chain Lightning, Corpse Skin, Protection, Resurrection, Energy Vortex, Dispel, Mana Drain, Mass Dispel, Strangle, Mind Rot, Recall, Mass Curse, FlameStrike, Arch Cure, Poison Field, Cure, Bless, Invisibility, Magic Trap, Summon Daemon, Harm, Agility, Summon Familiar, Blade Spirit, Sacred Journey, Meteor Swarm, Remove Curse, Energy Field, Enemy of one, Fire Field, Night Sight, Dispel Evil, Cleanse By Fire, Clumsy, Close Wounds, Consecrate Weapon, Reactive Armor, Magic Untrap, WraithForm, Lich Form, Wither, Vengeful Spirit, Air Elemental, Spell Reflection, Lightning, Explosion, Teleport, Animate Dead, Curse Weapon, Magic Lock, Unlock, Blood Oath, Mind Blast, Dispel Field, Evil Omen, Earth Elemental, Create Food, Water Elemental, Telekinesis, Weaken, Fire Elemental, Divine Fury, Vampiric Embrace, Pain Spike, FeebleMind, Earthquake, Paralyze, Magic Arrow, Horrific Beast, Heal, Poison, Gate, Poison Strike, Fire Ball, Incognito, Greater Heal </p><p><br> </p> <h2> <span class="mw-headline"> item hotkeys </span></h2> <ul><li> press ctrl+f1 - ctrl+f4 to mark items under the cursor for later usage, </li><li> press f1 - f4 to use them </li></ul> <p>you can define additional keys or use different keys like this : </p> <pre>SetMacro("ctrl+f5", function() MacroCmd_ItemSlot_Set(5) end) SetMacro("f5", function() MacroCmd_ItemSlot_Use(5) end) </pre> <p><br> you can make a bandage self macro like this : </p> <pre>SetMacro("f6", function() MacroCmd_Item_UseByName("bandage") MacroCmd_TargetSelf() end) </pre> <h2> <span class="mw-headline"> scripting </span></h2> <p>You can do complex scripting here, e.g. you can add conditions or similar. a guide to the lua scripting language is here : [http://www.lua.org/pil/] and a languag-reference is here : [http://www.lua.org/manual/5.0/] </p><p>you can also make conditional macros like this </p> <pre>if (MacroRead_PlayerStat("curHits") < 0.5*MacroRead_PlayerStat("maxHits")) then MacroCmd_Say("i'm half-dead !") end </pre> <p>(will trigger if the player health is below 50%) </p> <h2> <span class="mw-headline"> functions </span></h2> <p>currently available read functions for that : </p> <pre>MacroRead_PlayerStat(statname) -- read player stats, statname can be one of curHits,maxHits,curMana,maxMana,curStamina,maxStamina MacroRead_TargetStat(statname) -- read stats of selected target, statname can be one of curHits,maxHits </pre> === journal === gMyJournal = {} RegisterListenerOnce("Hook_Text",function (name,plaintext,serial,data) table.insert(gMyJournal,plaintext) ,"My_Hook_Text") lastid = #gMyJournal lastline = gMyJournal[#gMyJournal] === notes === <p>if you want to make a script that runs longer or waits for something, you need to start it as a job/coroutine: </p> <pre>job.create(function() -- place your code here DoSomething() job.wait(1000) -- waits 1sec DoAnotherThing() job.wait(1000) AddFadeLines("script finished") end) </pre> <p>not all commands from uo are implemented yet, please tell us which ones you consider most important of the missing ones. </p><p><br> for a list of all available functions see http://zwischenwelt.org/trac/iris/browser/trunk/lua/lib.macrolist.lua for complex script see [[Scripting]] easyuo ids : if (item.artid == easy2open("POF")) then ... end helpful to reload your macros on hotkey : <pre>SetMacro("ctrl+f9",function() dofile(gMacroPathFile) MacroCmd_RiseText(1,1,0,"reload") end)</pre> === example : bandage-loop === <pre> SetMacro("f3", function() gMyBandageLoopActive = not gMyBandageLoopActive end) job.create(function() while (true) do if (gMyBandageLoopActive) then MacroCmd_BandageSelf() end job.wait(3*1000) end end) </pre> == more == please visit [[Scripting_TippsAndTricks]]
Return to
Macros
.
Views
Page
Discussion
View source
History
Personal tools
Log in
main
Main Page
Screenshots
download
Install Guide
Forum
FAQ
Macros
Credits
dev
Developer Blog
A Guide for Artists
Development
Item Model List
Iris-Testshard
Bugreports
SvnLog
API C++
API Lua
wiki
Recent changes
Random page
Help
Search
Toolbox
What links here
Related changes
Special pages