store cad macro

macros macros macros

Moderators: Phineas, noivad

Post Reply
Talin
Noble
Posts: 1150
Joined: Sat Apr 03, 2004 4:13 pm
Profession: Healer
Race: Sylvan
Player Status: Active
Contact:

store cad macro

Post by Talin » Thu Dec 30, 2010 2:24 pm

Several people asked me for the store cad macro I am using. Lena originally wrote it, and Noivad kindly made a most useful extension. You know, the guy who is fixing space-time-continuum glitches on a daily basis. So you know the macro is pretty cool.

For those macro illiterates like me. Shift-click on a char fills up the f-key list, starting from f-5 - F-12. After defining those f-keys, given player can be healed by pressing said f-key. Changing the f-key is easy with the time-space-continuum fixer-guy's addition: Select a person, say with command-click, then command-f-key, and the f-key now heals that person. There are some other goodies in the macro, read it if you like :) I am planning an extension to shift-f-key for those pesky hunts where there are more than 8 people who need healing, but never got around to it. Taking applications of other time-space-continuum-workers who would work on such a project.

Code: Select all

//store-cadding (Lena)
"cc" call simple_cad1

setglobal counter1 1

shift-click
        {
        $any_click
        "/select " @clicksplayer \r
        setglobal player @splayer
        call button
        }

        
simple_cad1
        {
        setglobal player @splayer
        call button
        }
        
        
tab call displays

                
displays
        {
        if cadtarget5 == "cadtarget5"
                message "F5:  No player selected."
        else
                "/select " cadtarget5 \r
                message "F5: "cadtarget5
                                pause 1
        end if
        
        if cadtarget6 == "cadtarget6"
                message "F6:  No player selected."
        else
                        "/select " cadtarget6 \r
                message "F6: "cadtarget6
                pause 1
        end if
        
        if cadtarget7 == "cadtarget7"
                message "F7:  No player selected."
        else
                        "/select " cadtarget7 \r
                message "F7: "cadtarget7
                pause 1
        end if
        
        if cadtarget8 == "cadtarget8"
                message "F8:  No player selected."
        else
                        "/select " cadtarget8 \r
                message "F8: "cadtarget8
                pause 1
        end if
        if cadtarget9 == "cadtarget9"
                message "F9:  No player selected."
        else
                        "/select " cadtarget9 \r
                message "F9: "cadtarget9
                pause 1
        end if
        
        if cadtarget10 == "cadtarget10"
                message "F10:  No player selected."
        else
                        "/select " cadtarget10 \r
                message "F10: "cadtarget10
                pause 1
        end if
        
        if cadtarget11 == "cadtarget11"
                message "F11:  No player selected."
        else
                        "/select " cadtarget11 \r
                message "F11: "cadtarget11
                pause 1
        end if
        
        if cadtarget12 == "cadtarget12"
                message "F12:  No player selected."
        else
                        "/select " cadtarget12 \r
                message "F12: "cadtarget12
                pause 1
        end if  
        }
        
        


        
f5
        {

        if cadtarget5 == "cadtarget5"
                message "*No player selected"
        else
                setglobal player cadtarget5
                call button2
        end if
        }
        
f6
        {
        if cadtarget6 == "cadtarget6"
                                message "*No player selected"
        else
                setglobal player cadtarget6
                call button2
        end if
        }
        
f7
        {
        if cadtarget7 == "cadtarget7"
                                message "*No player selected"
        else
                setglobal player cadtarget7
                call button2
        end if
        }
        
f8
        {
        if cadtarget8 == "cadtarget8"
                                message "*No player selected"
        else
                setglobal player cadtarget8
                call button2
        end if
        }

f9
        {
        if cadtarget9 == "cadtarget9"
                                message "*No player selected"
        else
                setglobal player cadtarget9
                call button2
        end if
        }
        
f10
        {
        if cadtarget10 == "cadtarget10"
                                message "*No player selected"
        else
                setglobal player cadtarget10
                call button2
        end if
        }
        
f11
        {
        if cadtarget11 == "cadtarget11"
                                message "*No player selected"
        else
                setglobal player cadtarget11
                call button2
        end if
        }
        
f12
        {
        if cadtarget12 == "cadtarget12"
                                message "*No player selected"
        else
                setglobal player cadtarget12
                call button2
        end if
        }


button2
        {
        set user @my.name
        if player == ""
                call selfheal
        else if player == user
                call selfheal
        else
                call cad2
        end if
                }


button
        {
        set user @my.name
        if player == ""
                call selfheal
        else if player == user
                call selfheal
        else
                call cad
        end if
                }
                
                


                

selfheal
        {
        if @my.right_item == "moonstone"
                goto done
        end if
        "/equip moonstone" \r

        label wait_for_moonstone
        if @my.right_item == "moonstone"
                goto done
        else
                pause 2
                goto wait_for_moonstone
        end if

        label done
        "/use 3" \r
        }

cad
        {
        if @my.right_item == "asklepian staff"
                goto done
        end if
        "/equip asklepian staff"\r
        label wait_for_cad
        if @my.right_item == "asklepian staff"
                goto done
        else
                pause 2
                goto wait_for_cad
        end if

        label done
        "/use " player \r
        message "*You are healing " player "."
        call rotatename
        }
        

cad2
        {
        if @my.right_item == "asklepian staff"
                goto done
        end if
        "/equip asklepian staff"\r
        label wait_for_cad
        if @my.right_item == "asklepian staff"
                goto done
        else
                pause 2
                goto wait_for_cad
        end if

        label done
        "/use " player \r
        message "*You are healing " player "."

        }
        
rotatename
        {

        if counter1 == 1
                setglobal cadtarget5 ""
                setglobal cadtarget6 "cadtarget6"
                setglobal cadtarget7 "cadtarget7"       
                setglobal cadtarget8 "cadtarget8"
                setglobal cadtarget9 "cadtarget9"
                setglobal cadtarget10 "cadtarget10"
                setglobal cadtarget11 "cadtarget11"     
                setglobal cadtarget12 "cadtarget12"             
                                                

                setglobal cadtarget5 @splayer

        else if counter1 == 2
                setglobal cadtarget6 @splayer
        else if counter1 == 3
                setglobal cadtarget7 @splayer
        else if counter1 == 4
                setglobal cadtarget8 @splayer           
        else if counter1 == 5
                setglobal cadtarget9 @splayer           
        else if counter1 == 6
                setglobal cadtarget10 @splayer          
        else if counter1 == 7
                setglobal cadtarget11 @splayer  
        else if counter1 == 8
                setglobal cadtarget12 @splayer                  
        else
                message "*Invalid counter1" counter1
        end if
if counter1 == 8
                setglobal counter1 1

        else
                setglobal counter1 + 1
        end if
        }
 //Noivad's addition

command-F5 setglobal cadtarget5 @splayer
				
command-F6 setglobal cadtarget6 @splayer
		
command-F7 setglobal cadtarget7 @splayer
		
command-F8 setglobal cadtarget8 @splayer
		
command-F9 setglobal cadtarget9 @splayer
		
command-F10 setglobal cadtarget10 @splayer
		
command-F11 setglobal cadtarget11 @splayer
		
command-F12 setglobal cadtarget12 @splayer


Talin
Noble
Posts: 1150
Joined: Sat Apr 03, 2004 4:13 pm
Profession: Healer
Race: Sylvan
Player Status: Active
Contact:

Re: store cad macro

Post by Talin » Tue Jun 07, 2011 1:02 am

I enhanced the macro to 16 slots. Slot 9-16 can be chosen with ctrl-F5 to ctrl-F12, which can be handled by one hand as well with the thumb on the right ctrl-key.

Code: Select all

//store-cadding (Lena)
"cc" call simple_cad1

setglobal counter1 1

shift-click
        {
        $any_click
        "/select " @clicksplayer \r
        setglobal player @splayer
        call button
        }

        
simple_cad1
        {
        setglobal player @splayer
        call button
        }
        
        
tab call displays

                
displays
        {
        if cadtarget5 == "cadtarget5"
                message "F5:  No player selected."
        else
                "/select " cadtarget5 \r
                message "F5: "cadtarget5
                                pause 1
        end if
        
        if cadtarget6 == "cadtarget6"
                message "F6:  No player selected."
        else
                        "/select " cadtarget6 \r
                message "F6: "cadtarget6
                pause 1
        end if
        
        if cadtarget7 == "cadtarget7"
                message "F7:  No player selected."
        else
                        "/select " cadtarget7 \r
                message "F7: "cadtarget7
                pause 1
        end if
        
        if cadtarget8 == "cadtarget8"
                message "F8:  No player selected."
        else
                        "/select " cadtarget8 \r
                message "F8: "cadtarget8
                pause 1
        end if
        if cadtarget9 == "cadtarget9"
                message "F9:  No player selected."
        else
                        "/select " cadtarget9 \r
                message "F9: "cadtarget9
                pause 1
        end if
        
        if cadtarget10 == "cadtarget10"
                message "F10:  No player selected."
        else
                        "/select " cadtarget10 \r
                message "F10: "cadtarget10
                pause 1
        end if
        
        if cadtarget11 == "cadtarget11"
                message "F11:  No player selected."
        else
                        "/select " cadtarget11 \r
                message "F11: "cadtarget11
                pause 1
        end if
        
        if cadtarget12 == "cadtarget12"
                message "F12:  No player selected."
        else
                        "/select " cadtarget12 \r
                message "F12: "cadtarget12
                pause 1
        end if  
          if cadtarget13 == "cadtarget13"
                message "ctrl-f5:  No player selected."
        else
                "/select " cadtarget13 \r
                message "ctrl-f5: "cadtarget13
                                pause 1
        end if
        
        if cadtarget14 == "cadtarget14"
                message "ctrl-f6:  No player selected."
        else
                        "/select " cadtarget14 \r
                message "ctrl-f6: "cadtarget14
                pause 1
        end if
        
        if cadtarget15 == "cadtarget15"
                message "ctrl-f7:  No player selected."
        else
                        "/select " cadtarget15 \r
                message "ctrl-f7: "cadtarget15
                pause 1
        end if
        
        if cadtarget16 == "cadtarget16"
                message "ctrl-f8:  No player selected."
        else
                        "/select " cadtarget16 \r
                message "ctrl-f8: "cadtarget16
                pause 1
        end if
        if cadtarget17 == "cadtarget17"
                message "ctrl-f9:  No player selected."
        else
                        "/select " cadtarget17 \r
                message "ctrl-f9: "cadtarget17
                pause 1
        end if
        
        if cadtarget18 == "cadtarget18"
                message "ctrl-f10:  No player selected."
        else
                        "/select " cadtarget18 \r
                message "ctrl-f10: "cadtarget18
                pause 1
        end if
        
        if cadtarget19 == "cadtarget19"
                message "ctrl-f11:  No player selected."
        else
                        "/select " cadtarget19 \r
                message "ctrl-f11: "cadtarget19
                pause 1
        end if
        
        if cadtarget20 == "cadtarget20"
                message "ctrl-f12:  No player selected."
        else
                        "/select " cadtarget20 \r
                message "ctrl-f12: "cadtarget20
                pause 1
        end if  
        }
        
        


        
f5
        {

        if cadtarget5 == "cadtarget5"
                message "*No player selected"
        else
                setglobal player cadtarget5
                call button2
        end if
        }
        
f6
        {
        if cadtarget6 == "cadtarget6"
                                message "*No player selected"
        else
                setglobal player cadtarget6
                call button2
        end if
        }
        
f7
        {
        if cadtarget7 == "cadtarget7"
                                message "*No player selected"
        else
                setglobal player cadtarget7
                call button2
        end if
        }
        
f8
        {
        if cadtarget8 == "cadtarget8"
                                message "*No player selected"
        else
                setglobal player cadtarget8
                call button2
        end if
        }

f9
        {
        if cadtarget9 == "cadtarget9"
                                message "*No player selected"
        else
                setglobal player cadtarget9
                call button2
        end if
        }
        
f10
        {
        if cadtarget10 == "cadtarget10"
                                message "*No player selected"
        else
                setglobal player cadtarget10
                call button2
        end if
        }
        
f11
        {
        if cadtarget11 == "cadtarget11"
                                message "*No player selected"
        else
                setglobal player cadtarget11
                call button2
        end if
        }
        
f12
        {
        if cadtarget12 == "cadtarget12"
                                message "*No player selected"
        else
                setglobal player cadtarget12
                call button2
        end if
        }

control-f5
        {

        if cadtarget13 == "cadtarget13"
                message "*No player selected"
        else
                setglobal player cadtarget13
                call button2
        end if
        }
        
control-f6
        {
        if cadtarget14 == "cadtarget14"
                                message "*No player selected"
        else
                setglobal player cadtarget14
                call button2
        end if
        }
        
control-f7
        {
        if cadtarget15 == "cadtarget15"
                                message "*No player selected"
        else
                setglobal player cadtarget15
                call button2
        end if
        }
        
control-f8
        {
        if cadtarget16 == "cadtarget16"
                                message "*No player selected"
        else
                setglobal player cadtarget16
                call button2
        end if
        }

control-f9
        {
        if cadtarget17 == "cadtarget17"
                                message "*No player selected"
        else
                setglobal player cadtarget17
                call button2
        end if
        }
        
control-f10
        {
        if cadtarget18 == "cadtarget18"
                                message "*No player selected"
        else
                setglobal player cadtarget18
                call button2
        end if
        }
        
control-f11
        {
        if cadtarget19 == "cadtarget19"
                                message "*No player selected"
        else
                setglobal player cadtarget19
                call button2
        end if
        }
        
control-f12
        {
        if cadtarget20 == "cadtarget20"
                                message "*No player selected"
        else
                setglobal player cadtarget20
                call button2
        end if
        }


button2
        {
        set user @my.name
        if player == ""
                call selfheal
        else if player == user
                call selfheal
        else
                call cad2
        end if
                }


button
        {
        set user @my.name
        if player == ""
                call selfheal
        else if player == user
                call selfheal
        else
                call cad
        end if
                }
                
                


                

selfheal
        {
        if @my.right_item == "moonstone"
                goto done
        end if
        "/equip moonstone" \r

        label wait_for_moonstone
        if @my.right_item == "moonstone"
                goto done
        else
                pause 2
                goto wait_for_moonstone
        end if

        label done
        "/use 3" \r
        }

cad
        {
        if @my.right_item == "asklepian staff"
                goto done
        end if
        "/equip asklepian staff"\r
        label wait_for_cad
        if @my.right_item == "asklepian staff"
                goto done
        else
                pause 2
                goto wait_for_cad
        end if

        label done
        "/use " player \r
        message "*You are healing " player "."
        call rotatename
        }
        

cad2
        {
        if @my.right_item == "asklepian staff"
                goto done
        end if
        "/equip asklepian staff"\r
        label wait_for_cad
        if @my.right_item == "asklepian staff"
                goto done
        else
                pause 2
                goto wait_for_cad
        end if

        label done
        "/use " player \r
        message "*You are healing " player "."

        }
        
rotatename
        {

        if counter1 == 1
                setglobal cadtarget5 ""
                setglobal cadtarget6 "cadtarget6"
                setglobal cadtarget7 "cadtarget7"       
                setglobal cadtarget8 "cadtarget8"
                setglobal cadtarget9 "cadtarget9"
                setglobal cadtarget10 "cadtarget10"
                setglobal cadtarget11 "cadtarget11"     
                setglobal cadtarget12 "cadtarget12"             
				setglobal cadtarget13 "cadtarget13"
                setglobal cadtarget14 "cadtarget14"
                setglobal cadtarget15 "cadtarget15"       
                setglobal cadtarget16 "cadtarget16"
                setglobal cadtarget17 "cadtarget17"
                setglobal cadtarget18 "cadtarget18"
                setglobal cadtarget19 "cadtarget19"     
                setglobal cadtarget20 "cadtarget20"                                                 

                setglobal cadtarget5 @splayer

        else if counter1 == 2
                setglobal cadtarget6 @splayer
        else if counter1 == 3
                setglobal cadtarget7 @splayer
        else if counter1 == 4
                setglobal cadtarget8 @splayer           
        else if counter1 == 5
                setglobal cadtarget9 @splayer           
        else if counter1 == 6
                setglobal cadtarget10 @splayer          
        else if counter1 == 7
                setglobal cadtarget11 @splayer  
        else if counter1 == 8
                setglobal cadtarget12 @splayer 
        else if counter1 == 9
                setglobal cadtarget13 @splayer
        else if counter1 == 10
                setglobal cadtarget14 @splayer
        else if counter1 == 11
                setglobal cadtarget15 @splayer           
        else if counter1 == 12
                setglobal cadtarget16 @splayer           
        else if counter1 == 13
                setglobal cadtarget17 @splayer          
        else if counter1 == 14
                setglobal cadtarget18 @splayer  
        else if counter1 == 15
                setglobal cadtarget19 @splayer         
        else if counter1 == 16
                setglobal cadtarget20 @splayer               
                
        else
                message "*Invalid counter1" counter1
        end if
if counter1 == 16
                setglobal counter1 1

        else
                setglobal counter1 + 1
        end if
        }
 //Noivad's addition

command-F5 setglobal cadtarget5 @splayer
				
command-F6 setglobal cadtarget6 @splayer
		
command-F7 setglobal cadtarget7 @splayer
		
command-F8 setglobal cadtarget8 @splayer
		
command-F9 setglobal cadtarget9 @splayer
		
command-F10 setglobal cadtarget10 @splayer
		
command-F11 setglobal cadtarget11 @splayer
		
command-F12 setglobal cadtarget12 @splayer

command-control-f5 setglobal cadtarget13 @splayer
				
command-control-f6 setglobal cadtarget14 @splayer
		
command-control-f7 setglobal cadtarget15 @splayer
		
command-control-f8 setglobal cadtarget16 @splayer
		
command-control-f9 setglobal cadtarget17 @splayer
		
command-control-f10 setglobal cadtarget18 @splayer
		
command-control-f11 setglobal cadtarget19 @splayer
		
command-control-f12 setglobal cadtarget20 @splayer

Post Reply