I need your help / advice on a function of mine...
Code:
; ~ Description: Returns number of foes which meet certain conditions, given by the parameter
; ~ $HPPercentage = from 0(=0%) to 1(=100%), set the HP in % to return all valid enemies with less than your set %
; ~ $aKilledFoes = start this function if a certain amount of foes are killed (only works in HM)
; ~ $aRange = returns all valid enemies within this range
Func GetRemainingFoes($HPPercentage = 1, $aKilledFoes = 0, $aRange = $RANGE_NEARBY)
If GetFoesKilled() > $aKilledFoes Then
Local $lAgentArray = GetAgentArray(0xDB)
Local $lMe = GetAgentById(-2)
Local $lFoeCount = 0
For $i = 1 To $lAgentArray[0]
;If $lAgentArray[$i] = 0 Then ContinueLoop ; no Agent
If Not GetIsEnemy($lAgentArray[$i]) Then ContinueLoop ; not an enemy
If Not GetIsAlive($lAgentArray[$i]) Then ContinueLoop ; not alive
$Distance = GetDistance($lAgentArray[$i], -2)
If $Distance > $aRange Then ContinueLoop ; not in range
If GetTarget($lAgentArray[$i]) <> $lMe Then ContinueLoop ; not targeting me
$HP = DllStructGetData($lAgentArray[$i], 'HP')
If $HP > $HPPercentage Then ContinueLoop ; ignore the enemy if it has more than the set HP %
$lFoeCount += 1
Next
Return $lFoeCount
EndIf
EndFunc ;==>CheckRemainingFoes
Is this viable to check the remaining amount of foes in a kill loop?
Since my problem is that most functions don't work in loops (i think because they are called too much in a loop so they simply return 0).
I tried to use this function in a killing loop:
Code:
Func GetEnemiesWithinRange($aRange = $RANGE_AREA)
Local $lAgentArray = GetAgentArray(0xDB)
Local $lSubArray[$lAgentArray[0] + 1]
$lSubArray[0] = 0
Local $lMeXY = GetAgentXY(-2)
For $i = 1 To $lAgentArray[0]
If GetIsEnemy($lAgentArray[$i]) = 0 Or GetIsDead($lAgentArray[$i]) Then ContinueLoop
Local $lTargetXY = GetAgentXY($lAgentArray[$i])
If ComputeDistance($lMeXY[0], $lMeXY[1], $lTargetXY[0], $lTargetXY[1]) > $aRange Then ContinueLoop
$lSubArray[0] += 1
$lSubArray[$lSubArray[0]] = $lAgentArray[$i]
Next
ReDim $lSubArray[$lSubArray[0] + 1]
Return $lSubArray
EndFunc ;==>GetEnemiesWithinRange
To be honest it kind of seems like an over complicated way to go about it. Typically I just compare the distance between myself and the nearest enemy to enable the Fight loop and that works almost flawlessly since you can specify compass range to fight from which means you arent off running about the place.
Now I am not sure because I have never used the AgentArray like that, but I think GetMaxAgents into ComputeDistance would provide a better result. So maybe run the Kill loop to find an enemy within distance, get to the enemy, then run a check on all agents within 1450 range (I think thats compass? Maybe its 1250) and add it to the EnemiesToBeKilled or whatever you want to call it.
I have this function from a Kilroy bot that I use quite often now - all credits to whoever wrote it since I did not! It seems you could probably rework it for what you need by adding in the Counts/Range.
Code:
Func GetNearestPriority($lPriority)
Local $lNearestAgent = 0, $lNearestDistance = 100000000
Local $lDistance, $lAgentToCompare
Local $aAgent = GetAgentByID(-2)
For $i = 1 To GetMaxAgents()
$lAgentToCompare = GetAgentByID($i)
If DllStructGetData($lAgentToCompare, 'HP') < 0.005 Or DllStructGetData($lAgentToCompare, 'Allegiance') <> 0x3 Or DllStructGetData($lAgentToCompare, 'Type') <> 0xDB Or GetAgentName($lAgentToCompare) <> $lPriority Then ContinueLoop
$lDistance = (DllStructGetData($aAgent, 'X') - DllStructGetData($lAgentToCompare, 'X')) ^ 2 + (DllStructGetData($aAgent, 'Y') - DllStructGetData($lAgentToCompare, 'Y')) ^ 2
If $lDistance < $lNearestDistance Then
$lNearestAgent = $lAgentToCompare
$lNearestDistance = $lDistance
EndIf
Next
Return $lNearestAgent
EndFunc ;==>GetNearestPriority
1) Google AutoIt and download the latest version
2) Optional (Recommended) Download the scite editor and use this as default from the same link you found above..
3) you can right click the bot files and select edit with scite once the other steps are done and familiar-rise yourself with the scripts especially the #include lines usually at the top
(these lines will clue you in on what other files you should have in the bot directory)
4) download the latest gwa2.au3 and gwa2_headers.au3 files (use search the guild wars section or find link) --- some bot listers include this with there bots and you may be able to use this with bots that don't include these needed files by just copying them to the bot directory that needs them
5) select tools and run to execute the bot script -- have fun - read as much as you can in the forum so you learn the ins and outs of the autoit scripting language
Someone gave me this script for ToC shard farming it injects and runs the gui is nice clean and has a option for patheon bonus aswell as multi options for selling to merch and what type of items to pickup BUT it doesnt actualy make it to the farm casts sf dwarven and dark escape then waits a few seconds runs halfway to toc stops to cast shroud gets stuck and dies IF you manage to make it past that it stops at the start of toc and dies.. i have pretty much 0 exp at fixing/wrighting bots but figured it would be a nice add to the collection here if someone can fix it. PS i thought about taking the combat/run part of the most updated original script for toc and copy/paste it but im not sure how that would play out. i added the script with the gwa2 file i was givin for it all is open source
Does anyone have the Buff_Effect_ID's for Pcons? I am trying to pop more Pcons during a run but I do not want to use a timer. I would like to try to simply use the below like when using Skill_Effect_ID's:
Code:
Global $Pcon_Cupcake = ????
If GetChecked($UseCupcake) and GetEffectTimeRemaining($Pcon_Cupcake) > = 0 Then
UseCupcake()
EndIf
Any help is appreciated...Savsuds? Velvetmoon? Ralle? Tekka? TeamGR? TeamAwesome?
Anyone got an idea how i can check if target was already hit by a lead/offhand/double attack ?
And how to get the BuffID of several buffs? (e.g. "I am the Strongest")
Buff ID: I AM THE STRONGEST!=2355
To find a skill ID (buff ID) take a look at the constants.au3 in gwapi.
I'm running into some problems with these functions. When I use the HasEffect(1043) (SkillID from the skill "Rush" which I found while using "Rush" and watching in the Effects/Buffs). The function HasEffect seems to ALWAYS return False (tested with various Effects & Buffs), it always returns False. I'm not able to manage to find why it is going so wrong. I'm hopping that someone can help me.
Code:
;~ Description: Returns time remaining before an effect expires, in milliseconds.
Func GetEffectTimeRemaining($aEffect)
If Not IsDllStruct($aEffect) Then $aEffect = GetEffect($aEffect)
If IsArray($aEffect) Then Return 0
Return DllStructGetData($aEffect, 'Duration') * 1000 - (GetSkillTimer() - DllStructGetData($aEffect, 'TimeStamp'))
EndFunc ;==>GetEffectTimeRemaining
Code:
;Pass skill ID, returns True if you're under the effect
Func HasEffect($Effect)
If IsDllStruct($Effect) = 0 Then $Effect = GetSkillByID($Effect)
If DllStructGetData(GetEffect($Effect), 'SkillID') < 1 Then ; If you're not under effect
Return False
Else
Return True
EndIf
EndFunc ;==>HasEffect
Code:
;~ Description: Returns effect struct or array of effects.
Func GetEffect($aSkillID = 0, $aHeroNumber = 0)
Local $lEffectCount, $lEffectStructAddress
Local $lReturnArray[1] = [0]
Local $lOffset[4]
$lOffset[0] = 0
$lOffset[1] = 0x18
$lOffset[2] = 0x2C
$lOffset[3] = 0x510
Local $lCount = MemoryReadPtr($mBasePointer, $lOffset)
ReDim $lOffset[5]
$lOffset[3] = 0x508
Local $lBuffer
For $i = 0 To $lCount[1] - 1
$lOffset[4] = 0x24 * $i
$lBuffer = MemoryReadPtr($mBasePointer, $lOffset)
If $lBuffer[1] == GetHeroID($aHeroNumber) Then
$lOffset[4] = 0x1C + 0x24 * $i
$lEffectCount = MemoryReadPtr($mBasePointer, $lOffset)
ReDim $lOffset[6]
$lOffset[4] = 0x14 + 0x24 * $i
$lOffset[5] = 0
$lEffectStructAddress = MemoryReadPtr($mBasePointer, $lOffset)
If $aSkillID = 0 Then
ReDim $lReturnArray[$lEffectCount[1] + 1]
$lReturnArray[0] = $lEffectCount[1]
For $i = 0 To $lEffectCount[1] - 1
$lReturnArray[$i + 1] = DllStructCreate('long SkillId;long EffectType;long EffectId;long AgentId;float Duration;long TimeStamp')
$lEffectStructAddress[1] = $lEffectStructAddress[0] + 24 * $i
DllCall($mKernelHandle, 'int', 'ReadProcessMemory', 'int', $mGWProcHandle, 'int', $lEffectStructAddress[1], 'ptr', DllStructGetPtr($lReturnArray[$i + 1]), 'int', 24, 'int', '')
Next
ExitLoop
Else
Local $lReturn = DllStructCreate('long SkillId;long EffectType;long EffectId;long AgentId;float Duration;long TimeStamp')
For $i = 0 To $lEffectCount[1] - 1
DllCall($mKernelHandle, 'int', 'ReadProcessMemory', 'int', $mGWProcHandle, 'int', $lEffectStructAddress[0] + 24 * $i, 'ptr', DllStructGetPtr($lReturn), 'int', 24, 'int', '')
If DllStructGetData($lReturn, 'SkillID') = $aSkillID Then Return $lReturn
Next
EndIf
EndIf
Next
Return $lReturnArray
EndFunc ;==>GetEffect
I'm Searching for a solution to make the bot check if i'm under a specific effect (like Dash or Shadow Form,....). Can someone help me pls ?
Hello guys, i got hacked and gm didnt help me :( so i ask for help here 12/22/2009 - Kal Online - 25 Replies Hello guys, i got hacked 7 days ago, i sent a c/s to gms connected my id card, they told me twrite back after 7 days...
GM Reply
Hello.
This is Kalonline.
We checked over your report and blocked hackers.
HELP! I need help scripting 02/06/2007 - Conquer Online 2 - 1 Replies OK, I want to know how u ppl do it! I what program do u use to make them? cause i wanna help but i dun know how... somone plz reply!
L2Walker, scripting questions/help 12/13/2006 - Lineage 2 - 0 Replies Hey, just asking a few questions hope you don't mind ^_^
I'm looking to make a script so when I cast magic on something, the walker bot will cast, say Wind Strike, on the same thing, at the same time.
I've looked through the options in walker and have it setup now, but it doesn't cast at the same time, but when I've finished casting.
If this isn't possible, last time I checked Walker scripts could not pickup what was said in chat, is this still the case?
Thanks. ^_^
Note: If you...
I need help scripting 09/05/2006 - General Coding - 0 Replies Ok I am tired of leeching I am ready to try my hand at scripting but I dont know where to start and I was wondering if someone could help me get started or tell me a website that can help me learn so I can make my own hacks and contribute to the epvp community that we all love :D