Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;==================================
- ; Script Name: Autoloot with specific item looting capabilities
- ; Author: Patriot, Orngrimm
- ; Version: 1.0
- ; Client Tested with: 6.0.14.2
- ; EUO version tested with: 1.5 B 158
- ; Shard OSI / FS: both
- ; Revision Date: 15.6.2010
- ; Public Release: 9.6.2010
- ; Global Variables Used: none
- ; Purpose: opens and loots defined itemtypes.
- ; Some types (Armor, Weaps, Jewelry) is only looted it they match one property-string of a defined selection.
- ;==================================
- ;=========== SETUP ================
- set %property_looting_first #true
- set %lootprop1 Wizards , #SPC , Strong , #SPC , Arm
- set %lootprop2 spell , #SPC , channeling , #SPC , deed
- set %lootprop3 Black , #SPC , Lotus , #SPC , Hood
- set %lootprop4 A , #SPC , Runic , #SPC , Hammer
- set %lootprop5 Rough , #SPC , Stone
- set %lootprop6 stormgrips
- set %number_of_markers 6
- set %jewel _OWI
- set %gold _POF_OWI_IIE_NVI_WRO_MPF_XDI_LYD_MDP_AZF_SDJ_BFF_CFF_IFF_HFF_KEJ
- set %weapon _fuo_atf_npo_jph_tsf_nmh_vrh_jtf_soh_bph
- +_lsf_bsf_nsf_zrf_rmh_lph_uoh_hsf_zto_buo_xth_opo_cuo
- +_xrh_guo_mtf_rrh_vth_ysf_buh_auo_trh_zth_woh_usf_lmh
- +_qpo_ppo ; Added POF for normal gp's
- set %armor _gsh_osh_fik_gik_cik_nik_aik_mik_hlk_clk
- +_czh_jwi_gzh_ewi_bwi_jjn_vvi_wvi_xvi_yvi_iwi_hwi_kwi
- +_xvl_vjn_fci_jkh_njl_kkh_hkh_vkh_qkh_alh_xkh_ykh_mlh
- +_llh_qsk_ysk_atk_usk_osk_ssk_yph_vph_bqh_cqh_pph
- set %bag _ckf_lkf_zjf
- set %gems _uvf_vuf_gvf_evf_hvf_ovf_fvf_bvf_rvf_ZVF_NVF ; Added ZVF for turmaline, NVF for saphire
- set %regs _KUF_JUF_KZF_JZF_MZF_WZF_RZF_SZF_IUF_DUF_TZF_UZF_YZF
- ;=========== END SETUP ============
- ;=========== CONSTANTS ============
- ;=========== END CONSTANTS ========
- ;=========== Preparation =============
- if sys notin #opts
- {
- display ok enable system messages and hit play
- halt
- }
- if dmc notin #opts
- {
- display ok enable don't move cursor and hit play
- halt
- }
- menu Clear
- menu Window Title Corpse looter
- menu Window Color maroon
- menu Window Size 193 189
- menu Font Transparent #true
- menu Font Align Right
- menu Shape EUOShape1 -4 4 93 183 3 2 1 Yellow 2 White
- menu Font Name MS Sans Serif
- menu Font Size 10
- menu Font Style
- menu Font Color Yellow
- menu Font Transparent #false
- menu Font Align Left
- menu Font BGColor Maroon
- menu Text EUOLabel1 4 8 What to Loot:
- menu Font Size 8
- menu Font Color Green
- menu Text EUOLabel2 92 104 Current Weight
- menu Font Color Background
- menu Text EUOLabel3 92 132 % of Max Weight
- menu Font Color WindowText
- menu Text weight 104 120 EUOLabel4
- menu Text per 104 144 EUOLabel5
- menu Check gold 4 28 77 25 #false Gold
- menu Check weapons 4 52 77 25 #false Weapons
- menu Check armor 4 72 77 25 #false Armor
- menu Check jewelery 4 100 77 25 #false Jewelery
- menu Check bags 4 122 77 25 #false Bags
- menu Check gems 4 142 77 25 #false Gems
- menu Check regs 4 161 77 25 #false Regs
- menu Font BGColor Red
- menu Button cursor 92 0 103 25 Set Loot Location
- menu Button min 92 24 103 25 Min. Update Range
- menu Button norm 92 48 103 25 norm Update Range
- menu Button pause 92 72 103 25 Pause
- menu Show 421 270 halt
- set #menubutton closed
- ignoreitem reset
- ;=========== End Preparation =========
- ;=========== World-setup =============
- gosub cursor
- set %lootbagID #result
- ;=========== End World-setup =========
- ;=========== Maincode =============
- while #true
- {
- set %loot_all
- set %loot_always
- set %loot_prop
- menu get regs
- if #menures = -1
- set %loot_always %loot_always , %regs
- menu get gems
- if #menures = -1
- set %loot_always %loot_always , %gems
- menu get gold
- if #menures = -1
- set %loot_always %loot_always , %gold
- menu get weapons
- if #menures = -1
- set %loot_prop %loot_prop , %weapon
- menu get armor
- if #menures = -1
- set %loot_prop %loot_prop , %armor
- menu get jewelery
- if #menures = -1
- set %loot_prop %loot_prop , %jewel
- menu get bags
- if #menures = -1
- set %loot_always %loot_always , %bag
- if #menubutton = min
- {
- event macro 42 0
- set #menubutton closed
- }
- if #menubutton = norm
- {
- event macro 43 0
- set #menubutton closed
- }
- if #menubutton = pause
- {
- set #menubutton closed
- gosub pause
- }
- if #charghost = yes
- gosub pause
- if #menubutton = cursor
- gosub cursor
- if #weight <> %weight
- {
- set %weight #weight
- menu delete weight
- menu Text weight 104 120 #weight
- set %perc #weight * 100 / #maxweight
- menu delete per
- menu Text per 104 144 %perc
- }
- set %loot_all %loot_always , %loot_prop
- finditem YFM G_1
- if #findkind = -1
- continue ; Start over with a new iteration of the mainloop
- set %body #findid
- set #lobjectid #findid
- nextCPos 10 10
- ; Implemented a better setting of %bod
- event macro 17 0
- repeat
- {
- wait 1
- }
- until #CONTNAME = container_gump && #CONTSIZE = 144_212
- set %bod #ContID
- while #true ; loot-loop
- {
- finditem %loot_all C_ , %bod
- if #findCNT = 0
- {
- event SysMessage finished Corpse.
- ignoreitem %body
- wait 15
- }
- if %property_looting_first
- {
- gosub loot_prop %loot_prop %bod %number_of_markers %lootbagid
- gosub loot_always %loot_always %bod %lootbagid
- Break ; Looting finished. Break the loot-loop
- }
- else
- {
- gosub loot_always %loot_always %bod %lootbagid
- gosub loot_prop %loot_prop %bod %number_of_markers %lootbagid
- Break ; Looting finished. Break the loot-loop
- }
- } ; end loot-loop
- } ; end mainloop
- ;=========== End Maincode =========
- ;=========== SUBs =================
- ; -------------------------
- ; Sub name: cursor
- ; Autor: Patriot, Orngrimm
- ; Version: 1.0
- ; Purpose: Lets the User target a item and returns this ID.
- ; Params: none
- ; Outputs: #result ID of targetet item
- ; -------------------------
- sub cursor
- set #menubutton closed
- set #LTargetID NULL
- set #TargCurs 1
- event SysMessage Please click the lootbag.
- menu Window Color blue
- repeat
- {
- wait 1
- }
- until #LTargetID <> NULL
- menu Window Color Maroon
- return #LtargetID
- ; -------------------------
- ; Sub name: pause
- ; Autor: Patriot
- ; Version: 1.0
- ; Purpose: Pauses the script until the unpause-button is pressed.
- ; Params: none
- ; Outputs: none
- ; -------------------------
- sub pause
- menu Button pause 92 72 103 25 Resume
- while #menubutton <> pause
- {
- wait 1
- }
- menu Button pause 92 72 103 25 Pause
- set #menubutton closed
- return
- ; -------------------------
- ; Sub name: loot_prop
- ; Autor: Orngrimm
- ; Version: 1.0
- ; Purpose: Loots items with a specific type. But it loots them only if they meet a property-string-requirement
- ; Params: 1 req Lootlist
- ; 2 req Container-ID to loot from
- ; 3 req Ammount of markers %lootprop[#]
- ; 4 req Container-ID to store the loot
- ; Outputs: none
- ; -------------------------
- sub loot_prop
- if %0 < 4
- {
- display OK Incorrect ammount of atributes passed to the sub. Script pauses for debug.
- pause
- return
- }
- ; Create a new namesapce to have vars at our disposal which
- ; doesnt clutter the variable-space.
- nameSpace Push
- nameSpace Local #sysTime , #random
- ; Here we check for props and loot only those who meet the props
- Finditem %1 C_ , %2
- if #FindCNT > 0 ; Check only if we found anything
- {
- for #FindIndex #FindCNT 1 ; check all found items
- {
- event property #findID
- set !looted #false
- for !cnt_o 1 %3 ; check all markers
- {
- set !temp_o lootprop , !cnt_o
- set !temp_o % . !temp_o
- if !temp_o in #Property ; Here was a_o missing
- {
- exevent drag #FindID #Findstack
- exevent dropc %4
- wait 15
- set !looted #true
- break ; If we looted it, there is no need to check for the other props.
- }
- }
- ; Here we checked one item for all propertys. Ignore it if not interesting for looting
- if !looted = #false
- ignoreitem #FindID nonloot
- }
- }
- nameSpace Clear
- nameSpace Pop
- return
- ; -------------------------
- ; Sub name: loot_always
- ; Autor: Orngrimm
- ; Version: 1.0
- ; Purpose: It loots all defined from the defined container to the defined target
- ; Params: 1 req Lootlist
- ; 2 req Container-ID to loot from
- ; 3 req Container-ID to store the loot
- ; Outputs: none
- ; -------------------------
- sub loot_always
- if %0 < 3
- {
- display OK Incorrect ammount of atributes passed to the sub. Script pauses for debug.
- pause
- return
- }
- ; Here we check for props and loot only those who meet the props
- Finditem %1 C_ , %2
- if #FindCNT = 0
- return
- for #Findindex #FindCNT 1
- {
- exevent drag #FindID #Findstack
- exevent dropc %3
- wait 15
- }
- return
- ;=========== End SUBs =============
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement