PDA

View Full Version : How do i make a macro to tab/cycle through stances? plz help


Drizzo
11-10-2004, 08:19 PM
Alright i'm a complete noob at scripting, i know the concepts and all that but uhm, i dont really know the syntax for.. well.. barely anything.

I'm looking for a way to be able to TAB or rather CYCLE through stances/shapeshifts/etc.

As far as i know, and this is all i know (this is probably gibberish), it would go something like this:

/script value = (1-3); if ( value == 1 ) then SendChatMessage("/stance |bzrk|"); if ( value == 2 ) then SendChatMessage("/stance |battle|"); if ( value == 3 ) then SendChatMessag("/stance |defense|")

It probably doesnt work at all but, whatever, i dont know scripting at all. It's mostly just guessing.

the /stance |battle| and /stance |bzrk| and /stance |defense| are macro commands that cosmos adds used as switching to that stance.

I know that my example was complete crap ;p, so could somebody clue me in on how it could be done?

Thanks a lot :)

oh, and dont flame me plz lol

sarf
11-10-2004, 09:53 PM
This code should cycle between all shapes:/script maxForms=GetNumShapeshiftForms(); for i = 1, maxForms do _, name, isActive, _ = GetShapeshiftFormInfo(i); if ( isActive ) then if ( i == maxForms ) then CastShapeshiftForm(1); else CastShapeshiftForm(i + 1); end break; end end
Easier version (on the eyes):maxForms=GetNumShapeshiftForms();
for i = 1, maxForms do
_, name, isActive, _ = GetShapeshiftFormInfo(i);
if ( isActive ) then
-- are we at the end?
if ( i == maxForms ) then
-- yeah, do the first form
CastShapeshiftForm(1);
else
-- nah, do the next form
CastShapeshiftForm(i + 1);
end
break;
end
end
Hope this helps!

Sarf
---
"Anyone who is capable of being elected president should on no account be allowed to do the job." - The Hitchhikers Guide to the Galaxy

Drizzo
11-10-2004, 10:07 PM
thanks sarf! :D

this will work with stances right?

sarf
11-10-2004, 11:24 PM
It should.

Sarf
---
It's been a rough day.. I put a shirt on and a button fell off. Picked up my briefcase, and the handle came off. I'm afraid to go to the bathroom.