One button weapon swapper

eppy

Grandmaster
if not listexists 'swapweapons'

createlist 'swapweapons'

endif

if list 'swapweapons' < 1

pushlist 'swapweapons' 0x41cebcd4 //set serial here

pushlist 'swapweapons' 0x41cebe3d //set serial here

endif

if findobject 'lefthand'

clearhands 'both'

pause 500

endif

equipitem swapweapons[0] 1

poplist 'swapweapons' 'front'
 

Young Star

Grandmaster
NIce. I think I may try to figure out how to add a prompt for the weapons you want to use so you don't have to enter the serial numbers each time you use different ones.
 

eppy

Grandmaster
Just make a separate macro to prompt you and set those values. The variables are available across scripts.
 

halygon

Grandmaster
I have mine set a bit differently but similarly. I have a key that does the above, but it doesnt actually disarm and change the weapons. Instead my macro just changes out which weapon my disarm/arm key uses. I use a sysmsg to notify me which weapon is in queue to be armed next.

I have it setup this way because I carry a couple different weapons and when in the field or duel pits, i can pre-select my weapon without equipping it and giving away what I am going to use before I use it.


**Oh, I also have hotkeys set to "setalias" for the weapon aliases in my weapon selection macro. This way if I die, I can quickly set the weapons in my backpack so my macro knows which weapon is which (I hate dress macros for some reason).
 

halygon

Grandmaster
Here is my hotkey macro(s):

This first one doesn't actually arm any weapons, what it does is setup my arm/disarm hotkey with the correct weapon so when I disarm the current weapon and hit the arm hotkey, the newly selected weapon arms.
Code:
//Haly's Weapon Swapper
//2hweapon (layer 2)
//1hweapon (layer 1)
//Weap2Arm -> arming alias
//
//************START MACRO*************
//Check if list exists, if not create one
if not listexists 'weaponset'
  createlist 'weaponset'
endif
//if list is empty, set the 2handed weapon as active
if list 'weaponset' == 0
  @setalias 'Weap2Arm' '2hweapon'
  sysmsg '2-HAND WEAPON SET' '83'
  pushlist 'weaponset' '2hweaponinhand'
  //if list is not empty, set the 1handed weapon as active
else
  @setalias 'Weap2Arm' '1hweapon'
  sysmsg '1-HAND WEAPON SET' '30'
  @clearlist 'weaponset'
endif

Here is my Arm/Disarm Hotkey:
Code:
if @findobject 'righthand'
  clearhands! 'right'
elseif @findobject 'lefthand'
  clearhands! 'left'
else
  equipitem! 'Weap2Arm' 2
endif
 

cuneyt

Neophyte
Hey it's a great code, I modified it to ask for the weapons to swap between. It's here :
Code:
if not listexists 'swapweapons'
   promptalias 'w1'
   if not @findobject 'w1'
      stop
  endif
   promptalias 'w2'
   if not @findobject 'w2'
      stop
   endif
   createlist 'swapweapons'
endif

if list 'swapweapons' < 2
    pushlist 'swapweapons' 'w1' //set serial here
    pushlist 'swapweapons' 'w2' //set serial here
endif

if @findobject 'lefthand'
    clearhands 'both'
    if serial 'found' == swapweapons[0]
        equipitem swapweapons[1] 1
    else
        equipitem swapweapons[0] 1
    endif
        pause 500
else
    equipitem swapweapons[0] 1
endif
Also this is the code for removing the swap list for equipping new weapons :
Code:
if listexists 'swapweapons'
    removelist 'swapweapons'
endif

if listexists 'weapon'
    removelist 'weapon'
endif
And this code for equipping a third weapon for single use only to be able to switch between three weapons and use one of them separately (Basically, it replaces the built-in arm/disarm macro):
Code:
if not listexists 'weapon'
    promptalias 'w'
    if not @findobject 'w'
      stop
   endif
   createlist 'weapon'
endif

if list 'weapon' < 1
    pushlist 'weapon' 'w'
endif

if @findobject 'lefthand'
    clearhands 'both'

if serial 'found' != weapon[0]
    equipitem weapon[0] 1
endif
pause 500
else
    equipitem weapon[0] 1
    poplist 'weapon' 'front'
endif
It works based on the order you selected the weapons. Whenever you switched from single armed macro to swap macro, it always arms the first selected weapon so you can rely on the order you have determined before when fighting mobs.
 
Last edited:

baddie

Master
these scripts were contracted and paid by me for a better scripter to create. i've been using them for 3-4 years and they work perfectly.

not 1 button. i set alt1 2 3 for using weps, and control1 2 3 for setting them.

Code:
//weapon 1
//v1.01
@clearusequeue
@clearuseonce
@clearlist 'boolLeftHand'
if not @findalias 'weapon1' or not @findobject 'weapon1'
promptalias 'weapon1'
endif
if @findobject 'righthand' and @serial 'found' != serial 'weapon1'
while @findobject 'righthand'
@clearusequeue
@clearuseonce
clearhands 'right'
pause 650
endwhile
endif
if @findobject 'lefthand' and @serial 'found' != serial 'weapon1'
while @findobject 'lefthand'
@clearusequeue
@clearuseonce
clearhands 'left'
pause 650
endwhile
endif
while @findobject 'weapon1' 'any' 'backpack'
equipitem 'weapon1' '2'
@clearusequeue
@clearuseonce
pause 650
endwhile
if not @findobject 'weapon1'
headmsg '*Weapon1 not found!*' 50
endif
Code:
//set weapon 1
promptalias 'weapon1'

Code:
//v1.01
//weapon 2
@clearusequeue
@clearuseonce
@clearlist 'boolLeftHand'
if not @findalias 'weapon2' or not @findobject 'weapon2'
promptalias 'weapon2'
endif
if @findobject 'righthand' and @serial 'found' != serial 'weapon2'
while @findobject 'righthand'
@clearusequeue
@clearuseonce
clearhands 'right'
pause 650
endwhile
endif
if @findobject 'lefthand' and @serial 'found' != serial 'weapon2'
while @findobject 'lefthand'
@clearusequeue
@clearuseonce
clearhands 'left'
pause 650
endwhile
endif
while @findobject 'weapon2' 'any' 'backpack'
@clearusequeue
@clearuseonce
equipitem 'weapon2' '2'
pause 650
endwhile
if not @findobject 'weapon2'
headmsg '*Weapon 1 not found!*' 50
endif
Code:
//set weapon 2
promptalias 'weapon2'

Code:
//weapon 3
//v1.01
@clearusequeue
@clearuseonce
@clearlist 'boolLeftHand'
if not @findalias 'weapon3' or not @findobject 'weapon3'
promptalias 'weapon3'
endif
if @findobject 'righthand' and @serial 'found' != serial 'weapon3'
while @findobject 'righthand'
@clearusequeue
@clearuseonce
clearhands 'right'
pause 650
endwhile
endif
if @findobject 'lefthand' and @serial 'found' != serial 'weapon3'
while @findobject 'lefthand'
@clearusequeue
@clearuseonce
clearhands 'left'
pause 650
endwhile
endif
while @findobject 'weapon3' 'any' 'backpack'
@clearusequeue
@clearuseonce
equipitem 'weapon3' '2'
pause 650
endwhile
if not @findobject 'weapon3'
headmsg '*weapon 3 not found!*' 50
endif
Code:
//set weapon 3
promptalias 'weapon3'
 
Top