6
« on: April 03, 2016, 04:23:13 PM »
I finished my script its kinda ugly the travel subs are sad but i dont know how to use the better ones yet so theyll have to do. anyway my problem is that the client will randomly crash. its only happened twice so far once when dropping the maps in the trash can and once when recalling back to the room
;=============================================================================
;-- Script Name:Dark Guardian Farm
;-- Author: Tana
;-- Version: 1.0
;-- Client Tested with: 7.0.49.2
;-- EUO version tested with: 1.5.1.297
;-- Shard OSI
;-- Revision Date:4/3/16
;-- Public Release:
;-- Purpose: Faming TMAPS for clean up points
;-- Copyright: 2016
;=============================================================================
;--------------------Purpose--------------------------------------------------
;Kills Dark Guardians in Doom and loots the TMaps to throw away for Clean Up
;points
;=============================================================================
;-------------------Instructions----------------------------------------------
;WARNING this script does not check for Broken Gear
;This script requires that you have less then 13 items in your pack including
;your lootbag and Bag of Sending if your using it
;This Script assumes your a Sampire Using a double axe or other weapon with
;secondary ability being Whirlwind Attack
;Start script near your trash can
;Mark your trash can rune within 2 tiles of your trash can
;Mark your rune to the room outside of the dark guardian room at least 5 tiles
;west of the door
;If your using followers make sure they can survive in the rooom i use a swampy
;=============================================================================
;----------------Coming Soon--------------------------------------------------
;Better Travel Subs once I figure out how they work
;Better movement once I figure out a cleaner way for doing it Rails maybe?
;TM CLAw support once I figure out how to use it lol
;=============================================================================
;Special Thanks to The Ghost for dealing with my scripting questions
;Special Thanks to DXrom I borrowed a bit of his LAME script to set WW
;Special Thanks to TM for his BOS sub
;Special Thanks to the SUO community for being the great people that you are
;=============================================================================
;=============================================================================
;-------------Variables-------------------------------------------------------
;------------DO NOT EDIT------------------------------------------------------
;=============================================================================
;
SET %creature WD ;Dark Guardian
SET %loot XVH ;TMAPS
SET %trashcan CBQPOQD ;trashcan
SET %backpack #backpackid
SET %CORPSE YFM
set %safety 4 ;DO NOT EDIT
set %spellTimer #scnt2 ;DO NOT EDIT
set %attacking #false
set %looting #false
set %noloot #true
SET %setup #true
;=============================================================================
;-----------------MAINLOOP----------------------------------------------------
;=============================================================================
main:
if #charghost = yes
{
halt
}
if %setup = #true
{
gosub FirstSetup
}
gosub weightcheck
gosub attack
goto main
;=============================================================================
;-----------------MAINSUBS----------------------------------------------------
;=============================================================================
;-----------------------------------------------------------------------------
sub weightcheck
if %useBOS = #true
{
GOSUB BOS
}
finditem * c_ , %mapbag
IF #findcnt > 110
{
gosub gohome
}
return
;-----------------------------------------------------------------------------
sub attack
FINDITEM %creature G_6
if ( #findkind = -1 )
{
gosub loot
}
if ( #findkind = -1 ) && ( %noloot = #TRUE )
{
event pathfind 362 15
wait 20
event pathfind 365 15
wait 20
}
if #findkind <> -1
{
attackloop:
set %attacking #TRUE
if #findcnt > 0 && ( %spellTimer < #scnt2 )
gosub execSec
if #FINDKIND = -1 4
finditem %creature
set %attack #findid
set #LTARGETID %attack
event macro 27 0
if #findid <> %attack
{
set %attack #findid
set #LTARGETID %attack
event macro 27 0
goto attackloop
}
}
set %attacking #false
return
;-----------------------------------------------------------------------------
sub loot
;gosub get claw to start looting
;wait 90s for claw to finish and respawn time to pass
FINDITEM %CORPSE G_3
if ( #FINDKIND > -1 ) && ( %attacking = #false ) && ( %looting = #false )
{
set %noloot #false
goto lootloop
}
if #findkind = -1
{
set %noloot #true
}
lootloop:
set %newcorpse #findID
set #LOBJECTID %newcorpse
if #CONTTYPE = %CORPSE
{
set %opencorpse #CONTID
}
nextCPos 25 450
wait 20
EVENT MACRO 17
wait 20
FINDITEM %loot C_ , %opencorpse
if #findcnt > 0
{
set %looting #true
exevent drag #findID
wait 10
EXEVENT DROPC %mapbag
wait 10
}
if #findcnt < 1
{
set %looting #false
}
if %USEBOS = #true ;<------Got stuck when looting after the BOS ran out of charges changed this to fix it
{
FINDITEM POF C_ , %opencorpse
if #findcnt > 0
{
exevent drag #findID #findstack
wait 10
EXEVENT DROPC #BACKPACKID
wait 10
}
}
ignoreitem %newcorpse 1
return
;-----------------------------------------------------------------------------
sub dropoff
FINDITEM %loot C_ , %mapbag
if #FINDKIND > -1
{
goto droploop
}
droploop:
FINDITEM %loot C_ , %mapbag
set %trashmap #findid
EXEVENT DRAG %trashmap
wait 10
EXEVENT DROPC %trashcan
wait 10
ignoreitem %trashmap 2
if #findkind > -1
{
goto droploop
}
if #findkind = -1
{
gosub godemons
}
return
;-----------------------------------------------------------------------------
sub execSec
cmppix 3 f
{
event macro 36 0
wait 5
}
return
;-----------------------------------------------------------------------------
SUB BOS
finditem %BOS C_ , #BACKPACKID
if #FINDKIND <> -1
{
event property %BOS
str pos #PROPERTY Charges:
set #STRRES #STRRES + 9
str mid #PROPERTY #STRRES 1
if #STRRES = 0 ; as in zero charges
{
set %useBOS #false
return
}
if ( #weight > #maxweight ) && ( %useBOS = #true )
{
wait 10
set #LOBJECTID %BOS
EVENT MACRO 17
wait 10
FINDITEM POF C_ , %backpack
set %sendme #findid
SET #LTARGETID %sendme
EVENT MACRO 22
wait 10
}
}
if #FINDKIND = -1
{
SET %useBOS #false
}
return
;-----------------------------------------------------------------------------
;=============================================================================
;--------------TRAVEL SUBS----------------------------------------------------
;=============================================================================
sub gohome
if %followers = #true
{
event macro 1 0 all , #spc , follow , #spc , me
}
wait 20
EVENT pathfind 356 14
wait 40
EVENT MACRO 12 0
wait 40
EVENT pathfind 352 14
wait 20
SET #LTARGETID %homebook
EVENT MACRO 15 210
wait 60
EVENT MACRO 22 0
wait 5s
set #LOBJECTID %mapbag
EVENT MACRO 17
wait 20
gosub dropoff
return
;-----------------------------------------------------------------------------
sub godemons
SET #LTARGETID %doombook
EVENT MACRO 15 210
wait 60
EVENT MACRO 22 0
wait 5s
set #LOBJECTID %mapbag
EVENT MACRO 17
wait 60
if %followers = #true
{
EVENT MACRO 1 0 all , #spc , follow , #spc , me
}
EVENT pathfind 355 15
wait 60
EVENT MACRO 12 0
wait 20
EVENT pathfind 356 15
if %followers = #true
{
EVENT MACRO 1 0 all , #SPC , follow , #SPC , me
wait 15s
}
WAIT 10
EVENT pathfind 356 11
wait 40
if %followers = #true
{
EVENT MACRO 1 0 all , #SPC , follow , #SPC , me
}
wait 40
if %followers = #true
{
EVENT MACRO 1 0 All , #SPC , Stay
wair 5
}
EVENT pathfind 365 15
Return
;-----------------------------------------------------------------------------
;=============================================================================
;----------------SetUP Subs---------------------------------------------------
;=============================================================================
sub FirstSetup
display First we need to adjust the script for you.
wait 3
gosub opengumps
gosub setbos
gosub setmapbag
gosub settrash
gosub sethomebook
gosub setdoombook
gosub usefollowers
gosub setpixel-secondary
gosub traveltodoom
set %setup #false
return
sub setpixel-secondary
event macro 36 0
display Move the mouse to the BOTTOM LEFT CORNER of the secondary Weapon Move button. You have 2 seconds
wait 2s
savePix #CURSORX #CURSORY 3
wait 5
event macro 36 0
display Everything is set!
return
sub setbos
display yesno Do you want to use a Bag of Sending?
if #dispRes = yes
{
set %useBOS #true
display Please select your Bag Of Sending
set #targCurs 1
target
repeat
wait 1
until #targCurs = 0
set %BOS #LTARGETID
}
if #dispRes = no
{
set %useBOS #false
}
Return
sub setmapbag
display Please Select Your Map Bag.
set #targCurs 1
target
repeat
wait 1
until #targCurs = 0
set %mapbag #LTARGETID
set #LOBJECTID %mapbag
nextCpos 25 852
event macro 17
return
sub settrash
display Please Select Your Trash Can.
set #targCurs 1
target
repeat
wait 1
until #targCurs = 0
set %trashcan #LTARGETID
return
sub sethomebook
display Please Select Your runebook with your trash can rune set as default.
set #targCurs 1
target
repeat
wait 1
until #targCurs = 0
set %homebook #LTARGETID
return
sub setdoombook
display Please Select Your runebook with a rune outside of dark guardians room as default.
set #targCurs 1
target
repeat
wait 1
until #targCurs = 0
set %doombook #LTARGETID
return
sub usefollowers
display yesno Do you want to use followers to spawn more Guardians?
if #dispRes = yes
{
set %followers #true
}
if #dispRes = no
{
set %followers #false
}
return
sub traveltodoom
display Please Travel to the Dark guarding room resume script once inside
pause
set #LOBJECTID %mapbag
nextCpos 25 852
event macro 17
return
sub opengumps
EVENT MACRO 8 1
wait 10
EVENT MACRO 8 2
wait 10
EVENT MACRO 8 7
return
EDIT: Fixed part of the loot sub got stuck trying to loot gold when %useBOS changed to FALSE