Looking For Func

12/02/2019 17:07 alusion76#1
Hi guys !
I'm restarting in script after 2 years of break.
I update them so, but I miss some function.
I started several bot to finish the different stories and I use mainly GwBible for it.
So I have a function to "wait" at a given location ( Useful to wait mobs and kill them)
But this function calls on another that I do not.
It is really useful because it allows me to follow a NPC or camp at coord.
If anyone among you got it?


I send you the part of the script for camp:


And for follow npc:



And my problem is that, the bot crash because I do not have this function :
IsPartyAlive()

I think that it allows to continue the action, to follow or to wait, until change of map or the team dies.

If someone got it or use a different function ?

I can send you the complete script but there is a lot of work to be done.

And if someone wants to work with me to finish it quickly, it'll be really cool :)
12/09/2019 04:19 phat34#2
towards top of code in gwbible...
Code:
GLOBAL $MPARTYARRAY[13]
$MPARTYARRAY=MEMORYREADAGENTPTRSTRUCT(2,219,1)
with pointer functions in gwbible...
Code:
FUNC MEMORYREADAGENTPTRSTRUCT($AMODE=0,$ATYPE=219,$AALLEGIANCE=3,$ADEAD=FALSE )
LOCAL $LMAXAGENTS=GETMAXAGENTS()
LOCAL $LAGENTPTRSTRUCT=DLLSTRUCTCREATE("PTR["&$LMAXAGENTS&"]")
DLLCALL($MKERNELHANDLE,"BOOL","ReadProcessMemory","HANDLE",$MGWPROCHANDLE,"PTR",MEMORYREAD($MAGENTBASE),"STRUCT*",$LAGENTPTRSTRUCT,"ULONG_PTR",$LMAXAGENTS*4,"ULONG_PTR*",0)
LOCAL $LTEMP
LOCAL $LAGENTARRAY[$LMAXAGENTS+1]
SWITCH $AMODE
CASE 0
FOR $I=1 TO $LMAXAGENTS
$LTEMP=DLLSTRUCTGETDATA($LAGENTPTRSTRUCT,1,$I)
IF $LTEMP=0 THEN CONTINUELOOP
$LAGENTARRAY[0]+=1
$LAGENTARRAY[$LAGENTARRAY[0]]=$LTEMP
NEXT
CASE 1
FOR $I=1 TO $LMAXAGENTS
$LTEMP=DLLSTRUCTGETDATA($LAGENTPTRSTRUCT,1,$I)
IF $LTEMP=0 THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+156,"long")<>$ATYPE THEN CONTINUELOOP
$LAGENTARRAY[0]+=1
$LAGENTARRAY[$LAGENTARRAY[0]]=$LTEMP
NEXT
CASE 2
FOR $I=1 TO $LMAXAGENTS
$LTEMP=DLLSTRUCTGETDATA($LAGENTPTRSTRUCT,1,$I)
IF $LTEMP=0 THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+156,"long")<>$ATYPE THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+433,"byte")<>$AALLEGIANCE THEN CONTINUELOOP
$LAGENTARRAY[0]+=1
$LAGENTARRAY[$LAGENTARRAY[0]]=$LTEMP
NEXT
CASE 3
FOR $I=1 TO $LMAXAGENTS
$LTEMP=DLLSTRUCTGETDATA($LAGENTPTRSTRUCT,1,$I)
IF $LTEMP=0 THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+156,"long")<>$ATYPE THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+433,"byte")<>$AALLEGIANCE THEN CONTINUELOOP
IF MEMORYREAD($LTEMP+304,"float")<=0 THEN CONTINUELOOP
$LAGENTARRAY[0]+=1
$LAGENTARRAY[$LAGENTARRAY[0]]=$LTEMP
NEXT
ENDSWITCH
REDIM $LAGENTARRAY[$LAGENTARRAY[0]+1]
RETURN $LAGENTARRAY
ENDFUNC
#EndRegion AgentPtrArray
In your script ...

Code:
FUNC ISPARTYALIVE()
FOR $I=1 TO $MPARTYARRAY[0]
LOCAL $LANIMATION=MEMORYREAD($MPARTYARRAY[$I]+220,"byte")
IF $LANIMATION<>61 AND $LANIMATION<>62 THEN RETURN TRUE
NEXT
RETURN FALSE
ENDFUNC
:cool: