Author Topic: Scripts causing game to crash  (Read 3254 times)

0 Members and 1 Guest are viewing this topic.

Offline TanaTopic starter

  • Jr. Member
  • **
  • Posts: 67
  • Activity:
    0%
  • Reputation Power: 1
  • Tana has no influence.
  • Respect: +6
  • Referrals: 1
    • View Profile
Scripts causing game to crash
« on: February 04, 2016, 02:02:39 PM »
0
hey guys im using 3 scripts to attempt to farm T maps in doom for clean up turn ins, the way i have this going it works great! i Use CLAw to loot the maps and a script to spawn the guardians and a script to attack the guardians. for some reason the game will crash at various points. i think the problem is in the spawning script im using. can someone look over these and maybe fix the spawning script? i didn write any of these scripts slightly edited the spawning script to skip the looting cause it was a demon bone farming script thanks in advance



;=========================================
; Script Name: Raziel's Attack Script
; Author: Raziel, Tecmo
; Version: 1.20a
; Client Tested with: 5.0.1a
; EUO version tested with: 1.50.0060
; Shard OSI / FS: OSI and FS (Alexandria Tested Only)
; Revision Date: 2005-Nov-22
; Public Release: 2003-Aug-19
; Global Variables Used: None
; Purpose: Makes your warrior's hunting life all that much easier
; by Auto attacking preset creature when nearby.
;=========================================
 
;USER VARIABLES
;Set !_creature to the type of creatures you wish to auto attack
 
SET !_creature WD
SET !_AutoMoveToTarget #true ;#TRUE or #FALSE
SET !_lowHits 55
SET !_maxRange 10
; =====================================
IGNOREITEM reset
 
enemyloop:
FOR !_range 1 !_maxrange
{
   FINDITEM !_creature G_ , !_range
   IF #FINDKIND <> -1
   {
     SET #LTARGETID #FINDID
     SET !_enemy #FINDID
     GOSUB attack
   }
   WAIT 10
}
SET !_range 0
goto enemyLoop
 
; ================
SUB attack
attack_loop:
Event macro 36                         ;i added this so it would WW if its messing something up lemme know
EVENT macro 27
FINDITEM !_enemy G_
IF #FINDKIND = 1
{
   IF #HITS > !_lowHits && !_AutoMoveToTarget = #TRUE && #FINDDIST > 1
      MOVE #FINDX #FINDY a
   WAIT 20
         GOTO attack_loop
}
RETURN
; ================

that is the attack scrpit it works fine i beileve if i spawn them myself everything goes smooth


;Dark Guardian Farmer .2 Alpha by PetKiller 4/22/09
;RuneBook 1 called homebook have house rune as default location
;Runebook 2 called guardianbook have rune marked right infront of the door to guardian room.
;secure should be box/bag/ on your front porch next to where you recall to.
;Only pulls gold and bones still working on items using the loot eval.
;script is made for a dexer/mage    follow comments to change for chiv
;Have to set your own secure/homebook/guardianbook
;Lootbag not installed yet
;running about 3000-3300 bones per hour for me with demon sumoner spell.
;my char has hp regen 14 all 70s and 108 fencing and I use protection
;attack macros need work if you using pure dexor
;will auto leave room and wait bout 6 mins if someone else shows up.
;Don't restock bandies atm.

set %HumanTypes XU_AV_HS_IS
set %corpseid YFM_FEX_QEX
set %monsters WD           ;dark guardians
set %secure XXXXXXX        ;Id to your secure box at hour   YOU edit
set %homebook XXXXXXX      ;rune book with house rune as default location   YOU edit
set %guardianbook XXXXXXX  ;rune book with rune right in front of the door as default YOU edit
set %bandies ZLF           ;item id for bandaids
set %doors PJC             ;Item ID for doors at dark guardian room
set %flagwait 100
set %weapons YPO_BNF_CPH_INF_FSF_OSF_ASF_HNF_FMH_CNF_LSF_NSF_ISF_SMH_RMH_CSF_ZRF_MPH_LPH_MSF_BSF_KPO_GUO_KTF_JTF_BPH_EPH_ZSF_ATF_JPH_SOH_POH_NMH_OMH_LPO_ZTO_XTH_YTH_HSF_KSF_NPO_XPO_FUO_JPO_QPF_NPF_KPH_FYG_RHM_SFR_
    +SRH_AQF_PPF_TSF_WSF_BUO_VPO_WPO_WRH_VRH_XRH_YRH_LTF_MTF_OPO_CUO_
    +OLH_JOH_URH_EMH_WTH_DMH_QMH_CFF_BFF_PMH_GMH_ZPF_CQF_FFF_RPF_TRH_YSF_XSF_FBG_VTH_AUH_ZTH_UOH_VOH_AUO_MPO_BUH_CUH_DMH_GFF_QOH_HFF_TLH_GBG_
    +WOH_TOH_QPO_SPO_WOH_TOH_JSF_USF_LMH_MMH_QPO_SPO_PPO_RPO_JSF_USF_LMH_MMH_PPO_RPO_JSF_CWL_LWL_UJG_IJG_
set %weapons2 MMH_QPO_SPO_PPO_RPO_JSF_USF_LMH_MMH_PPO_RPO_JSF_CWL_LWL_UJG_IJG_

start:
set %loopers = 0
gosub ToonCheck
gosub weightcheck
gosub walkinside
gosub triggerspawn
gosub targets

sub gohome
set #lobjectid %homebook
set #ltargetid %homebook
set #ltargetkind 1
event macro 15 210        ;for chiv change to 15 210
target
wait 20
event macro 22 0
wait 40
return

sub gotoguardians
set #lobjectid %guardianbook
set #ltargetid %guardianbook
set #ltargetkind 1
event macro 15 210         ;chiv change to 15 210
target
wait 30
event macro 22 0
wait 40
if #charPosY = 14 || #charPosy = 15 ;make sure your guardian rune is marked on Y 14 or 15
     {
     return
     }
wait 120
gosub gotoguardians

sub opendoor
wait 20
finditem %monsters G_12 ;Don't try to open door is spawn still in there
if #findkind >= 1
     {
     gosub heal
     wait 50
     gosub heal
     wait 50
     gosub opendoor
     }
finditem %doors
set #lobjectid #findid
event macro 17
wait 10
return

sub walkinside                   ;the wait between subs works for my laggy connection
wait 20
gosub opendoor
wait 25
event pathfind 356 14
wait 25
return

sub walkoutside
event pathfind 356 14
msg all stay $
wait 110
event pathfind 354 14
gosub opendoor
wait 20
event pathfind 354 14
return

sub triggerspawn              ;could use a lot of work on this but works for now
set %loop = 0
event pathfind 366 15
gosub heal
gosub loot
wait 70
findItem %monsters G_12
if #findKind = -1
     {
     wait 70
     event pathfind 363 15
     wait 70
     }
gosub weightcheck
gosub targets
event pathfind 363 15
gosub targets
return

sub Targets                          ;more work needed here too
gosub heal
;set %loop = %loop +1
;if %loop >= 3
;     {
;     gosub triggerspawn
;     }
event pathfind 366 15
wait 50
event pathfind 363 15
gosub heal
gosub weightcheck
finditem %monsters G_12
if findKind = -1
     {
     wait 20
     gosub Targets
     }
;gosub triggerspawn
set %target #findID
set #ltargetID #findID
set #ltargetKind 1
set %flagwait ( #sCnt + 30 )
;repeat
event macro 27 0                        ;tried to have it keep attacking but would get stuck
;until #enemyid = n/a                   ;guardians will auto attack you anyway
wait 20
event macro 27 0
wait 140                                ;might have to lower this
gosub demon                             ;summon a demon to help fight and get more spawn
finditem %monsters G_12
set %target #findID
set #ltargetID #findID
set #ltargetKind 1
gosub weightcheck
gosub heal
set %loop = 0
gosub ToonCheck                          ;leave if someone shows up
gosub loot
wait 5                                  ;
gosub heal
gosub loot
wait 5
gosub heal
gosub weightcheck
gosub loot
wait 5
gosub heal
gosub loot
gosub Targets

gosub heal
goto demons:

sub weightcheck                              ;should add a bless or remove curse here maybe
if #weight > 395 || #weight > #maxweight     ;I have 130 str on elf adjust for being cursed
     {
     gosub walkoutside                       ;for chiv could put in a remove curse for overweight
     wait 80                                 ;tricky timer here
     gosub gohome
     wait 30
     gosub lootdrop
     wait 20
     goto start:
     }
wait 10
return

gosub weaponscheck
ignoreItem %corpseCondID
ignoreItem %corpse 1
ignoreItem %corpseContID
;set %loop +1
;wait 5;if %loop >= 4
return
;wait 40
;gosub loot
;return

sub weaponscheck
weapondamage
finditem %weapons , %corpseContID
if #findkind = -1
     {
     ignoreItem %corpseContID
     ignoreItem %corpse 1
     return
     }
;event property #findid
;if Poison in #property && Damage in #property && 100% in #property  ;pulling poison resist atm
;     {
;     exevent drag #findid 1
;     wait 20
;     exevent dropc #backpackid
;     wait 10
;     goto weapondamage
;     }
call BMItemEval.euo #findid
       wait 30
       if #result >= 22 ;(25 will only pull like 2 items per hour)
        {
        exevent drag #findid 1
        wait 10
        exevent dropc #backpackid
        goto weapondamage
        }
ignoreitem #findid
goto weapondamage
return

sub heal     ;uses magery to cast cure and heal and bandies
if C in #charstatus
{
wait 10
event macro 15 24  ;for chiv 15 201
target 60
event macro 23 0
wait 40
}
set %biotch2 #maxhits - 35
if #hits < %biotch2
    {
    event macro 15 28      ;for chiv 15 202
    target 60
    event macro 23
    wait 50
    }
if C in #charstatus
{
wait 10
event macro 15 10  ;for chiv 15 201
target 60
event macro 23 0
wait 20
}
set %biotch #maxhits - 15
if #hits < %biotch
    {
    finditem ZLF C_ , #backpackid
   ;if #findkind <> -1
    set #lobjectId #findId
    event macro 17
    target 5s
    event macro 23
    wait 20
    event macro 15 3   ;for chiv 15 202
    target 60
    event macro 23
    }
wait 5
return

sub lootdrop
;gosub backpack
wait 40                        ;set high for my laggy house
finditem %secure
if #findcnt = 1
     {
     finditem %resources C_ , #backpackid         ;have to use backpack sub if you get in a loop here
     if #findcnt < 1
     {
     goto start:
     }
     exevent drag #findid #findstack
     wait 10
     exevent dropc %secure
     wait 10
     finditem %weapons  C_ , #backpackid
     exevent drag #findid #findstack
     wait 20
     exevent dropc %secure
     wait 20
     finditem %weapons C_ , #backpackid
     exevent drag #findid 1
     wait 10
     exevent dropc %secure
     wait 30
     set %loopers = %loopers + 1
     if %loopers >= 5                 ;reopen backpack cause something is screwed
     goto backpack
     gosub lootdrop
     }
gosub weightcheck

sub ToonCheck
set %HumanTypes HS_IS_XU_AV                 ;keeps people from watching the script run
ToonCheck
Finditem %HumanTypes G_10
if #findcnt > 1
     {
     sound tada.wav
     gosub walkoutside                       ;
     wait 80                                 ;tricky timer here
     gosub gohome
     wait 60
     event pathfind XXXX XXXX               ;to walk onto my porch
     wait 200
     event macro 13 21                      ;hide
     wait 200
     if H notIn #charStatus
     event macro 13 21
     wait 289s                               ;wait 3 mins
     event macro 13 21
     wait 289s                               ;wait 3 more mins
     goto start:                             ;restart
     }   
return


backpack:                                 ;sub to reopen backpack if you get phantom items in backpack
event macro 9 7
wait 40
event macro 8 7
contpos 700 525
wait 40
return

 this is the demon bone farming script i grabbed to make the guardians spawn

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: Scripts causing game to crash
« Reply #1 on: February 04, 2016, 02:24:15 PM »
0
This is because you are probably trying to drag an items,moves and trying to attack a monster.   This is to much for the client. u need to stop fighting while you are looting.

Offline TanaTopic starter

  • Jr. Member
  • **
  • Posts: 67
  • Activity:
    0%
  • Reputation Power: 1
  • Tana has no influence.
  • Respect: +6
  • Referrals: 1
    • View Profile
Re: Scripts causing game to crash
« Reply #2 on: February 04, 2016, 04:48:11 PM »
0
thanks for your reply i was thinking the same thing im a total noob when it comes to script writing im trying to figure it out by reading the guides and disecting other peoples scripts, on that note could you maybe give me an idea an how a single script for doing this would work? like make guardians spawn kill guardians wait for loot then make guardians spawn again

Tags: