PDA

View Full Version : Addon: CycleCommand v0.05


sarf
11-13-2004, 02:25 PM
Greetings!

Thanks to a suggestion made on these forums, I created CycleCommand.

What it does is that it gives you the ability to create commands which, when run, have different results than from when they were run the last time.

For instance, you can make a command do "/s Run, fools!" then on the second execution "/s Well, you can't say I didn't tell you..." or whatnot.

It can also be used to shorten commands, since you don't have to have more than one command in it.

To use it, you must first enable it, which you do in the Cosmos menu or using the /cyclecommandtoggle command.

Then, just type /cyclecommand (or /cc), read the usage instructions and then get cracking!

Note that you use ## to seperate commands from each other.

Download it from here:
http://www.fukt.bth.se/~k/wow/scripts/CycleCommand/

Example add command:
/cyclecommand add Smurf /say I'm a smurf!#CC#/script CycleCommand_Print("In reality, while smurfs are cute, I like girls better.");##/say I like Gnomes!##/say Gnomes rule!

Hope it works for you!

Version history:
0.05 - new interface version
0.04 - added multiple command per cycle handling (use #CC#), fixed documentation error
0.03 - fixed the spamming of chat messages when using Cosmos
0.02 - fixed pipe error, added example to usage code
0.01 - initial release

Sarf
---
If you take a fly and rip off its wings, will it be called a 'walk'?

Meraxes
11-13-2004, 05:29 PM
read the usage instructions and then get cracking!


Lol I think you are going to need to update those instructions... I'm a computer programmer and even I have a hard time figuring this out.

From the LUA (NOTE you have a screen bug.. when this is shown on the screen your pipe characters chop out characters, probably can't use them in LUA the way you are. For example, when you see this ingame you get)

Usage : /cyclecommand [<addemoveesetun|update>]

instead of

Usage : /cyclecommand [<add\|remove\|reset\|run\|update>]

Had to dig around the LUA's to find the REAL usage syntax.

Even then it's a bit obscure:

commandName [command[##command[##command[...]]]]\ncommandName is case-insensitive.\nCommands should use ## as a seperator between them, as specified above."

I'm guessing.. /cyclecommand add TestMe ##/say Run ##/say RunFast!

But its not exactly working...

can you provide a working example?

sarf
11-13-2004, 05:53 PM
Yeah, fixed the pipe error but forgot to upload it... Added example.

Thanks for the bug report!

Sarf
---
All Wood? Oh! AL Wood. I didn't see the missing "L" at first.

Meraxes
11-13-2004, 06:33 PM
Cool got it working..

I haven't found the snippet of code to cast a spell via a macro (if it's even possible anymore), but will this support it?

Or is it just for chat commands?

sarf
11-13-2004, 08:29 PM
Just for chat commands... it probably CAN cast a spell if you use it in a macro.

Hint:
/cast SpellName(Rank rankNumber)

;)

Sarf
---
Cut the conversation, just open your mouth

Anonymous
11-14-2004, 04:44 AM
Awesome! Thanks Sarf! Question about it - how would i get it running multiple commands instead of just one? I figured I could set up macros for each but I have a limited amount of macros and I'm not even sure how to get them running...

Meraxes
11-14-2004, 07:43 AM
Just for chat commands... it probably CAN cast a spell if you use it in a macro.


Yep yep it works ;)

Made a macro called "Pulling" , where the CC PULL is a few text and emote combos :)

/cast Frostbolt(Rank 2)
/cc Run Pull
/v Incoming



HOWEVER.. another bug it seems.

/cc update xxx gives "Update command does not exist" :(

Also using the newest version the text in the /cc listing still is garbled a bit:

/cyclecommand[<addemoveesetun|update>] commandName
is shown in the window.. but we do get the nice new smurf example :)

Anonymous
11-14-2004, 08:42 AM
Lol i was the inspiration for this add-on. w00t w00t?! :D

sarf
11-14-2004, 12:23 PM
Oops.

Update not working

Note that for CycleCommand, there's no difference between adding something and updating it, but I've added the update command to my source code.

Usage problem:

I've replaced the | with / now. Hope it works. :(

Guest, what do you mean with multiple commands?

It can currently only do one command per "cycle", however that can be changed...

<WHACK BONK KLONK>

Done.

If you use #CC# between commands, it will use them perfectly. Note that you CAN NOT use two /cast commands... or rather, it won't work.

The example was updated, too.

Sarf
---
"Little girls, like butterflies, need no excuse." - Robert A. Heinlein, "The Notebooks of Lazarus Long"

Anonymous
11-14-2004, 03:50 PM
I was that Guest... so in the new version, say I wanted it to make me sit down and say 'Time for a sit' and a second press to cheer and go 'I'm happy', I'd do

/cc add Silliness /sit#CC#/say Time for a sit##/cheer#CC#/say I'm happy

?

sarf
11-14-2004, 08:19 PM
Yes.

Sarf
---
Practice safe snacking - use condiments.

jafo2com
11-16-2004, 08:40 AM
Off topic, but in relation to the /macro command comments. On one side of the coin, it is frustrating a macro can not have two or more /cast lines listed. There are lots of redundant keypresses/combos in WoW imho. On the other side of the coin I know Blizzard made it that way to really keep the person at the keyboard involved and at attention. *shrug With that in mind, I have a question for you all. What purpose is the following macro command:

/in <seconds> <do this command>

I do not know of any situation offhand that requires a timed pause before issuing a keypress/command. The only purpose I can see it being used for is:

/cast <spell x here>
/in 3 /cast <spell y here>

But, of course, multiple /cast commands are not allowed in macros. So...

Thoughts?

sarf
11-16-2004, 02:12 PM
Example:

/cast Pyroblast(Rank 4)
/in 5 /say Eat fire, slimeball!

or

/say Whew... need a long pause.
/usetype Food
/in 24 /usetype Food

Sarf
---
The president's weird. He's got a burgundy beard. It's a ripoff.

Anonymous
12-04-2004, 03:17 PM
Cyclecommand no longer seems to work for me. Use of /cc or /cyclecommand clears the chat window? :(

sarf
12-06-2004, 08:07 PM
Is it still installed?

Is there a CycleCommand directory in <WoW>\Interface\AddOns? Does it contain files?

Sarf
---
Ignorance can be cured -- but stupid is forever.

Anonymous
12-07-2004, 04:44 AM
There used to be when I checked... let me try reinstalling it.

Uranium - 235
12-07-2004, 04:47 AM
For some reason this damn thing isn't saving my cookies. Anyway, I removed, reinstalled, reloaded, and reactivated it, and it still doesn't work, but the menu option is still there to 'turn it on'. Useing it clears the chat log. When I'm done with gnomeragon I'll totally remove and reinstall cosmos and see if that fixes it.

Drav
12-08-2004, 07:50 PM
Hey sarf, couple questions for you, which I'll get to, but let me explain first. I'm a rogue, and I made myself a weapon switching macro, thanks to some help, which looks like this:

/script if ( not CursorHasItem() ) then PickupContainerItem(3, 2); PickupInventoryItem(16); PickupContainerItem(3, 2); PickupContainerItem(3, 3); PickupInventoryItem(17); PickupContainerItem(3, 3); end

Works great for me, and for anyone else with two sets of things they want to switch in and out. It picks up the weapon in bag 3, slot 2, and puts it in my main hand, and puts what was in my hand back in 3,2. Same for offhand weapon. Great, we're doing fine.

The problem comes in for my warrior buddy, who has three weapon sets to switch in and out -- dual wield wpns, 1h wpn + shield, and 2h weapon. We tried some things but there's a problem with three swaps. I can start with dual wield and get them to snap into my hand with this script. They are in slots 1 and 2 in my bag. Then when I switch to shield mode, I have to take from slot 3, which moves my off hand weapon into slot 3 of my bag, so when i switch back to dual wield, there is no weapon in bag slot 2. You see the problem there.

Ideally, we'd like to use this cyclecommand thingy to rotate through the weapon sets -- hit key once equips dual wield wpns, hit key again switches to 1h+shield, hit key again equips 2h wpn, hit key again equips dual wield wpns, and so on. Is this possible, and if so how would I do it?

Alternatively, I thought we could equip the weapons by name, which would be three separate macros, one each to equip the weapon set. Something like (in pseudo-code):

DW:
/script EquipWpn ("Dual Wield Wpn 1"); Put old mainhand item down; EquipWpn ("Dual Wield Wpn 2"); Put old offhand item down; end

1h+shield:
/script EquipWpn ("1-hand Wpn"); Put old mainhand item down; EquipWpn ("Shield"); Put old offhand item down; end

2h:
/script Put offhand item down; EquipWpn ("2-hand Wpn"); Put old mainhand item down; end

And finally, whichever way we end up getting it to work, we'd also like to add the warrior stances to it, since each weaponset matches up to a particular stance he's in. Hitting the Battle macro would switch him to Battle stance and equip the 2h. Hitting the Defense macro would switch him to Defense stance equip the 1h+shield. Hitting the Berserk macro would switch him to Berserk stance and goes to dual wield wpns. So how do I add the stance-changing to a macro? Would it just be: /cast Defensive Stance ?

Thanks for any help you can give, I know it's not exactly on topic, but it is, because the endgoal is to get all the stance/wpn switching on one key and cycle through them. :)


---------------------------------------------------------------------

UPDATE

Ok I think I got it, I found this:
If you are using Cosmos, you can use the following commands :

/equip <Item Name>
/unequip <Item Name>
/saveset <Number>
/loadset <Number>

So if I got this right, all you have to do is equip the dual wield weapons and type /saveset 1 which should save that set of equip as #1. Put on the 1h+shield and do /saveset 2 then 2h and do /saveset 3.

Then the macros will look like this:

/cast Berserker Stance
/loadset 1

/cast Defensive Stance
/loadset 2

/cast Battle Stance
/loadset 3

Though I could be wrong on how to actually save a set, I'm just guessing you put the shit on and then type the command, I'll have to test it.


-------------------------------------------------------

UPDATE 2

Well since I tested /saveset and it doesn't work from the command line or in a macro, I have no clue how to use it.

We'll just have to hardcode it...

/cast Berserker Stance
/equip Mainhand Weapon Name
/equip Offhand Weapon Name
end

/cast Defensive Stance
/equip Main 1h Weapon Name
/equip Shield Name
end

/cast Battle Stance
/equip 2h Weapon Name
end


You'll have to update the weapon names in the macros when you upgrade but it should work fine otherwise. Right?

----------------------------------------------------


Why isn't this working??????????????/ akdfjskkfljsd

sarf
12-10-2004, 08:18 AM
The /equip /*set commands were left out unintentionally. They will make an appearance again (prolly on my snapshot place first).

Once I get more time I could tell you how to do a cycle command for that...

Sarf
---
You sound reasonable... Time to up the medication.

Drav
12-10-2004, 05:20 PM
Thank you, sir.

Email me anytime, drav at dravness dot com.

sarf
12-13-2004, 05:51 PM
When I have gotten /equipoffhand it should look like this:

/stance Beserker Stance
/equip Mainhand Weapon Name
/equipoffhand Offhand Weapon Name

/stance Defensive Stance
/equip Main 1h Weapon Name
/equipoffhand Shield Name

/stance Battle Stance
/equip 2h Weapon Name

Made into a CycleCommand called WarriorCycle:

/cyclecommand add WarriorCycle /stance Beserker Stance#CC#/equip Mainhand Weapon Name#CC#/equipoffhand Offhand Weapon Name##/stance Defensive Stance#CC#/equip Main 1h Weapon Name#CC#/equipoffhand Shield Name##/stance Battle Stance#CC#/equip 2h Weapon Name

To run:
/cyclecommand run WarriorCycle

Sarf
---
No matter where you are, there you go? Wait a second.

Anonymous
12-17-2004, 08:05 PM
I can't get either .05 or .06 to load.

Are there known dependencies (other then cosmos) or conflicts?

I get no errors on login or console reloadui, don't see any options relating to cyclecommand in cosmos or the keybindings and commands like /cyclecommandtoggle, /cyclecommand and /cc don't do anything.

(On a possibly related note it seems both cooldowncount and cyclecommand use /ccenable)

thanks
Thago

sarf
12-17-2004, 09:14 PM
Are you perchance using a non-EU version of WoW?

http://www.fukt.bth.se/~k/wow/stuff/howto-change-.toc-files.txt

Sarf
---
I couldn't afford a cool signature, so I just got this one.

Anonymous
12-18-2004, 12:06 AM
Indeed I am.

thanks
Thago

Anonymous
12-20-2004, 03:17 AM
ok... i finally got it installed correctly, had the wrong version number

im doing this...

/cc add bash /cast Shield Bash(Rank 1)

and it adds the command.... now i do
/cc run bash
and it does nothing.... i dunno whats wrong with it, if i type /cast Shield Bash(Rank 1) in the chat bar it does nothing, the only time i can get the written command to work is in the in-game macro.

sarf
12-20-2004, 10:57 AM
To get /cast stuff working, the scripts have to be run from a macro.

Sarf
---
Life size models of Cthulhu, on sale now!

d4rk_r3b3l
12-20-2004, 01:25 PM
i did infact make a seperate macro for the /cc run bash.... but it didnt work

Arc2055
01-04-2005, 06:34 PM
Does this still work in the current Cosmos?
Last time I tried installing, the commands didn't work.

Just checking before I try installing again.

EdgeClub
02-24-2005, 05:20 AM
Sarf, does this addon randomly use commands stored in the cyclecommand queue or does it execute them consecutively til the queue is complete and then restarts queue?

Meraxes
03-31-2006, 02:04 AM
Has this been abandoned?

It no longer seems to work due to the RegisterforSave function..

I can modify it myself if someone knows a workaround.. trying to look up exactly what REgisterforSave did and what the new syntax is.

morbid_o
03-31-2006, 03:23 PM
Has this been abandoned?

It no longer seems to work due to the RegisterforSave function..

I can modify it myself if someone knows a workaround.. trying to look up exactly what REgisterforSave did and what the new syntax is.

http://www.wowwiki.com/HOWTO:_Save_Variables_Between_Game_Sessions