Author Topic: Script doesnt leave attack sub  (Read 3084 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
Script doesnt leave attack sub
« on: March 31, 2016, 12:08:55 PM »
0
Hey guys ive been working on this script to farm TMAPS for turn in points at the dark guardians in doom. the spawn and attack parts of the script work great (thanks DXrom i used some snipits of his LAME script) but i cant figure out how to get the script to stop and loot the maps.. i thought i had everything done right but im sure ive failed. would love it if someone could look it over and tell me how much oh a dunce i am lol


Thanks Tana


Code: [Select]
;-----------------Variables-------------------
;
;
SET %creature WD ;Dark Guardian
SET %loot XVH ;gold TMAPS ect
SET %homebook OXGABND
SET %doombook UWVWWQD
SET %secure ;trashcan
SET %backpack CJSXQOD
SET %CORPSE YFM
set %safety 4 ;DO NOT EDIT
set %spellTimer #scnt2 ;DO NOT EDIT


;-----------------MAINLOOP------------------------
main:
if %setupWW = #TURE
{
gosub pixelFirst
}
gosub weightcheck
FINDITEM %CORPSE G_3
if findkind <> -1
{
gosub loot
}
gosub attack
goto main
;============================================================================
;-----------------MAINSUBS------------------------
;===========================================================================

;-----------------------------------------------------------------------------
sub weightcheck
finditem * c_ %backpack
IF #weight > 400 || #findcnt > 120
   {
   gosub gohome
   }
   return
;------------------------------------------------------


sub attack
FINDITEM %creature G_6
if #findkind = -1
{
  event pathfind 362 15
wait 20
event pathfind 365 15
wait 20
 }
if #findkind <> -1
{
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
}
return
;------------------------------------------------

sub loot
;gosub get claw to start looting
;wait 90s for claw to finish and respawn time to pass
FINDITEM %CORPSE
WHILE #FINDKIND <> -1
{
set %opencorps #findID
set #LTARGETID %opencorpse
EVENT MACRO 22
FINDITEM C_%opencorpse %loot
if #FINDKIND > -1
{
exevent drag #findID
wait 10
EVENT DROPC %lootbag
}
ignoreitem %opencorpse 1
}
}
return
;------------------------------------------------

sub execSec
    cmppix 3 f
       {
       event macro 36 0
       wait 5
       }
return

;------------------------------------------------

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: Script doesnt leave attack sub
« Reply #1 on: March 31, 2016, 03:24:39 PM »
0
You need to stop attacking while looting, so at the end of your main loop u need to sub loot and repeat a loop until u are done.   TM have something build in in his looter.  U can look there. 

Offline TanaTopic starter

  • Jr. Member
  • **
  • Posts: 67
  • Activity:
    0%
  • Reputation Power: 1
  • Tana has no influence.
  • Respect: +6
  • Referrals: 1
    • View Profile
Re: Script doesnt leave attack sub
« Reply #2 on: April 01, 2016, 01:56:10 PM »
0
ok ive done some editing and now it stops opens the corpse and then when it doesnt find anything it returns to attacking so my new problem is that it doesnt find the TMAP on the body i think i have the code right im not sure


Code: [Select]
;-----------------Variables-------------------
;
;
SET %creature WD ;Dark Guardian
SET %loot XVH ;gold TMAPS ect
SET %homebook OXGABND
SET %doombook UWVWWQD
SET %secure ;trashcan
SET %backpack #backpackid
SET %CORPSE YFM
set %safety 4 ;DO NOT EDIT
set %spellTimer #scnt2 ;DO NOT EDIT
set %attacking #false
set %noloot #true

;-----------------MAINLOOP------------------------
main:
if %setupWW = #TURE
{
gosub pixelFirst
}
gosub weightcheck
gosub attack
goto main
;============================================================================
;-----------------MAINSUBS------------------------
;===========================================================================

;-----------------------------------------------------------------------------
sub weightcheck
finditem * c_%backpack
IF #weight > 400 || #findcnt > 120
   {
   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 )
   {
   set %noloot #false
   goto lootloop
   }
if #findkind = -1
   {
   set %noloot #true
   }
lootloop:
set %newcorpse #findID
set #LOBJECTID %newcorpse
EVENT MACRO 17
set %openorpse #contID
wait 20
FINDITEM C_%opencorpse %loot ;<<<<<<<<<<<<<<<<<<<<this is the line that i think is wrong
 if #FINDCNT > 0
   {
   Pause
   exevent drag #findID
   wait 10
   EVENT DROPC %lootbag
   }
ignoreitem %newcorpse 1

return
;------------------------------------------------

sub execSec
    cmppix 3 f
       {
       event macro 36 0
       wait 5
       }
return

;------------------------------------------------
;----------------SetUP Subs----------------------



sub pixelFirst
display First we need to adjust the script to your spells.
wait 3
gosub setpixel-secondary
set %setupWW #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

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: Script doesnt leave attack sub
« Reply #3 on: April 01, 2016, 07:06:27 PM »
0
You need something like this. 
Not tested

Code: [Select]
set %corpseID YFM

sub lootmap
finditem %corpseID G_2
   if #findkind = -1
        Return
if #findkind = 1
goto lootcoarpse
{
set #lobjectid #findid
event macro 17 0
ignoreitem #findid
loot:
IF #CONTTYPE = YFM
    set %corpse #contid
    FINDITEM %itemtype C_ , %corpse
If #findkind = -1
  {
   wait %loot
   goto loop
  }
  wait %loot
{
 exevent drag #findid #findstack
   exevent dropc  #backpackid
   wait 20
}
return


Offline TanaTopic starter

  • Jr. Member
  • **
  • Posts: 67
  • Activity:
    0%
  • Reputation Power: 1
  • Tana has no influence.
  • Respect: +6
  • Referrals: 1
    • View Profile
Re: Script doesnt leave attack sub
« Reply #4 on: April 01, 2016, 07:37:57 PM »
0
im not 100% sure what i did but i have it working now


Code: [Select]
;------------------------------------------------------


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 )
   {
   set %noloot #false
   goto lootloop
   }
if #findkind = -1
   {
   set %noloot #true
   }

lootloop:
set %newcorpse #findID
set #LOBJECTID %newcorpse
set %opencorpse #CONTID
nextCPos 25 450
wait 20
EVENT MACRO 17
wait 20
FINDITEM %loot C_ , %opencorpse
if #findcnt > 0
 {
   exevent drag #findID
   wait 10
   EXEVENT DROPC %lootbag
   wait 10
 }
FINDITEM POF C_ , %opencorpse
if #findcnt > 0
 {
   exevent drag #findID #findstack
   wait 10
   EXEVENT DROPC #BACKPACKID
   wait 10
 }
ignoreitem %newcorpse 1
return
;------------------------------------------------

sub execSec
    cmppix 3 f
       {
       event macro 36 0
       wait 5
       }
return
;------------------------------------------------

Tags: