Openkore.com
http://forums.openkore.com/

Macros: Relog when Striped and Repair broken item
http://forums.openkore.com/viewtopic.php?f=33&t=209665
Page 1 of 1

Author:  fukki [ 02 Nov 2014, 00:39 ]
Post subject:  Macros: Relog when Striped and Repair broken item

First you need to set your "items_control.txt" and "pickupitems.txt"
if you not set it bot will sell or drop your item :D

Ex: items_control.txt
Code:
+4 Maya Hat [Orc Hero] 1 0 0
+7 Orlean's Server [Maya] [1] 1 0 0
+8 Meteor Plate [Tao Gunka] [1] 1 0 0
+7 Ice Pick [Phreeoni] [1] 1 0 0

BROKEN +4 Maya Hat [Orc Hero] 1 0 0
BROKEN +7 Orlean's Server [Maya] [1] 1 0 0
BROKEN +8 Meteor Plate [Tao Gunka] [1] 1 0 0
BROKEN +7 Ice Pick [Phreeoni] [1] 1 0 0


Ex: pickupitems.txt
Code:
+4 Maya Hat [Orc Hero] 0
+7 Orlean's Server [Maya] [1] 0
+8 Meteor Plate [Tao Gunka] [1] 0
+7 Ice Pick [Phreeoni] [1] 0

BROKEN +4 Maya Hat [Orc Hero] 0
BROKEN +7 Orlean's Server [Maya] [1] 0
BROKEN +8 Meteor Plate [Tao Gunka] [1] 0
BROKEN +7 Ice Pick [Phreeoni] [1] 0


now you can use this macros for check your item when Striped
just fix location to your save map and $sItemName to your item ;)
Code:
automacro CheckHelm {
   location not <SaveMap>
   equipped topHead none
   status not Strip Helm
   exclusive 1
   run-once 1
   call {
      $sItemName = +4 Maya Hat [Orc Hero]

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto b2spawn
      release CheckHelm
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release CheckHelm
      stop
      :b2spawn
      do respawn
      release CheckHelm
   }
}
automacro CheckArmor {
   location not <SaveMap>
   equipped armor none
   status not Strip Armor
   exclusive 1
   run-once 1
   call {
      $sItemName = +8 Meteor Plate [Tao Gunka]

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto b2spawn
      release CheckArmor
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release CheckArmor
      stop
      :b2spawn
      do respawn
      release CheckArmor
   }
}
automacro CheckRightHand {
   location not <SaveMap>
   equipped rightHand none
   status not Strip Weapon
   exclusive 1
   run-once 1
   call {
      $sItemName = +7 Ice Pick [Phreeoni] [1]

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto b2spawn
      release CheckRightHand
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release CheckRightHand
      stop
      :b2spawn
      do respawn
      release CheckRightHand
   }
}
automacro CheckLeftHand {
   location not <SaveMap>
   equipped leftHand none
   status not Strip Shield
   exclusive 1
   call {
      $sItemName = +7 Orlean's Server [Maya] [1]

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto b2spawn
      release CheckLeftHand
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release CheckLeftHand
      stop
      :b2spawn
      do respawn
      release CheckLeftHand
   }
}


now your repair macros
Code:
automacro RepairArmor {
   location <SaveMap>
   equipped armor none
   status not Strip Armor
   exclusive 1
   run-once 1
   call {
      $sItemName = +8 Meteor Plate [Tao Gunka]
      $sNpcTalk = 183 104 c r13 c r1 c r0 c c r0 n #Npc location and talk step
      $sUseMove = 0 #If you want to move set to 1
      $sMove = <SaveMap> x y

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto repair
      release RepairArmor
      stop
      :repair
      if ($sMove > 0) {do move $sMove}
      do talknpc $sNpcTalk
      $iGetNormal = @invamount ($sItemName)
      if ($iGetNormal > 0) goto wareeq
      release RepairArmor
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release RepairArmor
   }
}
automacro RepairRightHand {
   location <SaveMap>
   equipped rightHand none
   status not Strip Weapon
   exclusive 1
   run-once 1
   call {
      $sItemName = +7 Ice Pick [Phreeoni] [1]
      $sNpcTalk = 183 104 c r13 c r1 c r0 c c r0 n #Npc location and talk step
      $sUseMove = 0 #If you want to move set to 1
      $sMove = <SaveMap> x y

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto repair
      release RepairRightHand
      stop
      :repair
      if ($sMove > 0) {do move $sMove}
      do talknpc $sNpcTalk
      $iGetNormal = @invamount ($sItemName)
      if ($iGetNormal > 0) goto wareeq
      release RepairRightHand
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release RepairRightHand
   }
}
automacro RepairLeftHand {
   location <SaveMap>
   equipped leftHand none
   status not Strip Shield
   exclusive 1
   run-once 1
   call {
      $sItemName = +7 Orlean's Server [Maya] [1]
      $sNpcTalk = 183 104 c r13 c r1 c r0 c c r0 n #Npc location and talk step
      $sUseMove = 0 #If you want to move set to 1
      $sMove = <SaveMap> x y

      $iGetNormal = @invamount ($sItemName)
      $iGetBroken = @invamount (BROKEN $sItemName)
      if ($iGetNormal > 0) goto wareeq
      if ($iGetBroken > 0) goto repair
      release RepairLeftHand
      stop
      :repair
      if ($sMove > 0) {do move $sMove}
      do talknpc $sNpcTalk
      $iGetNormal = @invamount ($sItemName)
      if ($iGetNormal > 0) goto wareeq
      release RepairLeftHand
      stop
      :wareeq
      $iItemNumber = @inventory ($sItemName)
      do eq $iItemNumber
      release RepairLeftHand
   }
}


and relog when Striped
Code:
automacro CheckStripHelm {
   status Strip Helm
   exclusive 1
   run-once 1
   call {
      do relog 5
      release CheckStripHelm
   }
}
automacro CheckStripArmor {
   status Strip Armor
   exclusive 1
   run-once 1
   call {
      do relog 5
      release CheckStripArmor
   }
}
automacro CheckStripWeapon {
   status Strip Weapon
   exclusive 1
   run-once 1
   call {
      do relog 5
      release CheckStripWeapon
   }
}
automacro CheckStripShield {
   status Strip Shield
   exclusive 1
   run-once 1
   call {
      do relog 5
      release CheckStripShield
   }
}

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/