Iris2.de

Iris2-Forum
It is currently Mon Dec 30, 2024 3:54 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: hotkey plugins
PostPosted: Mon Mar 09, 2009 8:17 pm 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
i am working on better casting spells hotkey plugin, i had a problem for example when trying to autoheal with mymacros.lua, i need to click everytime the hotkey, if not i fizzles my spells cuz it recast the spell before getting first target...

i want to create a plugin to let me cast spell and autolasttarget/selftarget, while holding pressed a hotkey, for example, i want to do this action:

SetMacro("1", function() MacroCmd_MiniHealCureSelf()end))

any suggestion on how to do this...

i am kinda new to lua.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 10, 2009 12:37 am 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
so you want to make a plugin that sets a few hotkeys automatically at startup ?

what happens if you just write

SetMacro("1", function() MacroCmd_MiniHealCureSelf()end))

in your plugin file ? i think that should work without any additional work


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 10, 2009 1:10 am 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
well yes it works, but i am trying to script something so if i hold down "1" it will run the script one time, when finished, and while still holding the key it will keep runing the script / macro, right now, there is a huge delay after key strokes send if i hold anykey, is there a way to reduce this delay ?, i tried in chat even, i pressed and hold down the key "J" it just wrote one J in the chat window :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 10, 2009 1:33 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
try

Code:
RegisterStepper(function ()
  if (gKeyPressed[key_a]) then
   
    -- ... your code here ...
   
   
  end
end)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 10, 2009 5:58 pm 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
it worked tx a lot :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 11, 2009 5:56 pm 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
another question, is there any way to select a target and show their healthbar without the plugin already set in iris2,in the normal client when u set a macro for this it popup the healthbar of that mobile. i was trying to use

if (gKeyPressed[key_a]) then
SelectNextMobile()
end

but it is not working correctly... seems like select next mobile is not active in the server,same as MacroCmd_AttackSelectedMobile()


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 12:01 am 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
is there any variable that is active while casting any spell, for example

while castingspell do
variablex = true
end
variablex = false


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 2:46 am 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
if you want a variable to be true while a spell is being cast, this should work most of the time :

RegisterListener("Hook_SendSpell",function (spellid) gMySpellIsCasting = true end)

RegisterListener("Hook_TargetMode_Start",function () gMySpellIsCasting = false end)

RegisterListener("Hook_Spell_Interrupt",function () gMySpellIsCasting = false end)

however, there is no generic way to detect the end of a spell that affects yourself, like nightvision.

in Hook_SendSpell : you can use GetSpellNameByID(spellid) to transform the spellid into the name of the spell, e.g. for use by print(spellid,GetSpellNameByID(spellid)) (shows up in the black console window)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 8:56 am 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
those three lines worked, but i had to add a wait line after those three because it was crashing cuz memory problems it said in the console, spell macro is almost done, at least for healing/and few attacking, sorry for bothering but i have some more questions, i noticed that when i try to cast while frozen or paralyzed a spell i get into a infinite loop, my question is: is there any way to get check if my character is paralyzed with parablow or paralyze spell? is this stat different than the froze u get while casting a spell?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 2:11 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
Maybe one of the unknown flags in the playermobile, but it might also be impossible to tell if the player is frozen.

Code:
local bPoisoned   = TestBit(GetPlayerMobile().flag,kMobileFlag_Poisoned)

kMobileFlag_Unknown1      = hex2num("0x01")
kMobileFlag_Unknown2      = hex2num("0x02") -- either CanAlterPaperdoll (necro) or Female (jerrit)
kMobileFlag_Poisoned      = hex2num("0x04")
kMobileFlag_GoldenHealth   = hex2num("0x08") -- = YellowHits , healthbar gets yellow (bleed attack, caused by troglodytes for example, can't healt then)
kMobileFlag_FactionShip      = hex2num("0x10") -- unsure why client needs to know
kMobileFlag_Movable         = hex2num("0x20") -- Movable if normally not
kMobileFlag_WarMode         = hex2num("0x40")
kMobileFlag_Hidden         = hex2num("0x80") -- probably self while hiding/stealth-walking, displayed as gray in original client


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 3:40 pm 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
wow, u are like wikipedia :) tx for the answers, i can get mortal status from this too :), i will post plugins as soon as i finish all spells and enable/disable in game hotkey.

i like iris2 so far, is kinda user friendly, maybe u guys could develop a less graphical engine too for pvp in servers like Pre-AOS, i was checking some files to edit the animations, so far i am improving it by disabling some animations,
any suggestion about this ?
one more question, can i smooth walk/run in iris 2d?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 7:29 pm 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
you're welcome =)

for pvp try those :

ToggleMultiOnlyShowFloor() (for 2d mode, look through walls, also improves performance a bit)

MacroCmd_GetSmartTargetForLastSpell() (the blue indicator in the moblist on the right, good for heal/cure in party and dumping spells on the selected (red line) enemy, i play with this as my main trigger :

Code:
SetMacro("wheeldown",      function() MacroCmd_SendTargetSerial(MacroCmd_GetSmartTargetForLastSpell(),gSpellCastRange) end)


local mob = MacroCmd_FindNearestNonFriendlyPlayer() (nonfriendly = not in party, prefers players to monsters)
MobListSetMainTargetSerial(mob and mob.serial or 0)

(i'm no pvp expert though *g*)

tilefree walk in 2d is not possible currently.

how do you mean less graphical ? to save performance ? or do you mean the moblist and stuff are unfair for pvp ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 12, 2009 7:44 pm 
Offline

Joined: Sat Mar 07, 2009 4:03 pm
Posts: 13
Well atm i was trying both clients, normal + easyuo and iris, with iris i can create scripts as good as in easyuo, problem is with iris when i run around houses it lags more than normal client, i tried to change grafic settings, for example in pvp we can disable animations, or make simple trees to compare to normal client in performance, even i like iris much more than normal client cuz it has a lot of +++, and u can change easily from 2d to 3r with hotkey.

i am going to give a try to those lines u send :)

btw: i love to pvp with mage :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 13, 2009 10:26 am 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
what you can also try to improve speed in pvp :

gDisableCompassDynamics = true

that prevents dynamics, especially in houses, showing up in the compass.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 21, 2009 8:37 pm 
Offline
User avatar

Joined: Sat Nov 15, 2008 9:07 am
Posts: 16
Location: Knoxville, Tn
What would be the command macro for attack(or auto attack)? Razor won't import it and I couldn't find it in macros.lua.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group