Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Guild Wars > GW Bots
You last visited: Today at 16:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



OK to ask for exploit/Scripting help here...

Discussion on OK to ask for exploit/Scripting help here... within the GW Bots forum part of the Guild Wars category.

Reply
 
Old 12/10/2019, 08:12   #241
 
elite*gold: 0
Join Date: Feb 2014
Posts: 181
Received Thanks: 337
Quote:
Originally Posted by Death_Fire View Post
Hey,

I updated my Tengu Bot and its still working but the Pickup Function is broken.
Any Tips what I have to change?
Find the Pickup_Loot function and take a look at as well as the CanPickUp() function. See what items it has listed and compare the function with a bot that is working.

If you post those functions here then we can see where there might be a problem.

Regards,
RiflemanX
RiflemanX is offline  
Old 12/10/2019, 10:06   #242
 
elite*gold: 0
Join Date: Sep 2019
Posts: 32
Received Thanks: 0
Quote:
Originally Posted by RiflemanX View Post
Find the Pickup_Loot function and take a look at as well as the CanPickUp() function. See what items it has listed and compare the function with a bot that is working.

If you post those functions here then we can see where there might be a problem.

Regards,
RiflemanX

I have this one :
Func CanPickUp2($aitem)
$ModelID = DllStructGetData(($aitem), 'ModelID')
$ExtraID = DllStructGetData($aitem, "ExtraId")
$lRarity = GetRarity($aitem)
$t = DllStructGetData($aitem, 'Type')
If $t = 20 Then
Return True
ElseIf $ModelID == 36985 Then
$nbCitations += 1
GUICtrlSetData($stCitations, $nbCitations)
Return True
ElseIf GUICtrlRead($gold) = $GUI_CHECKED Then
If $lRarity = 2624 Then
Return True ; gold items
EndIf
ElseIf GUICtrlRead($green) = $GUI_CHECKED Then
If $lRarity = 2627 Then
Return True ; green items
EndIf
ElseIf $ModelID = 28434 Then
Return True
ElseIf $lRarity = 2624 Then
If GUICtrlRead($dragon) = $GUI_CHECKED Then
If $ModelID = 736 Then
Return True
EndIf
EndIf
If GUICtrlRead($bo) = $GUI_CHECKED Then
If $ModelID = 735 Then
Return True
EndIf
EndIf
If GUICtrlRead($bladed) = $GUI_CHECKED Then
If $ModelID = 778 Then
Return True
EndIf
EndIf
If GUICtrlRead($bladed) = $GUI_CHECKED Then
If $ModelID = 777 Then
Return True
EndIf
EndIf
If GUICtrlRead($spiked) = $GUI_CHECKED Then
If $ModelID = 871 Then
Return True
EndIf
EndIf
If GUICtrlRead($spiked) = $GUI_CHECKED Then
If $ModelID = 872 Then
Return True
EndIf
EndIf
If GUICtrlRead($jitte) = $GUI_CHECKED Then
If $ModelID = 741 Then
Return True
EndIf
EndIf
If GUICtrlRead($diamond) = $GUI_CHECKED Then
If $ModelID = 2294 Then
Return True
EndIf
EndIf
If GUICtrlRead($Iridescent) = $GUI_CHECKED Then
If $ModelID = 2298 Then
Return True
EndIf
EndIf
If GUICtrlRead($Iridescent) = $GUI_CHECKED Then
If $ModelID = 2299 Then
Return True
EndIf
EndIf
If GUICtrlRead($Iridescent) = $GUI_CHECKED Then
If $ModelID = 2297 Then
Return True
EndIf
EndIf
ElseIf GUICtrlRead($pcons) = $GUI_CHECKED Then
If $ModelID = 28434 Or $ModelID = 22752 Or $ModelID = 22269 Or $ModelID = 28436 Or $ModelID = 31152 Or $ModelID = 31151 Or $ModelID = 31153 Or $ModelID = 35121 Or $ModelID = 28433 Or $ModelID = 26784 Or $ModelID = 6370 Or $ModelID = 21488 Or $ModelID = 21489 Or $ModelID = 22191 Or $ModelID = 24862 Or $ModelID = 21492 Or $ModelID = 22644 Or $ModelID = 30855 Or $ModelID = 5585 Or $ModelID = 24593 Or $ModelID = 6375 Or $ModelID = 22190 Or $ModelID = 6049 Or $ModelID = 910 Or $ModelID = 28435 Or $ModelID = 6369 Or $ModelID = 21809 Or $ModelID = 21810 Or $ModelID = 21813 Or $ModelID = 6376 Or $ModelID = 6368 Or $ModelID = 29436 Or $ModelID = 21491 Then
Return True ; pcons
EndIf
ElseIf $ModelID = 146 Then
If $ExtraID = 10 Or $ExtraID = 12 Then
Return False
EndIf
If $ModelID = 22751 Then
Return True
EndIf
EndIf
EndFunc ;==>CanPickUp2


Maybe you see what I cant see
Thx for help
Death_Fire is offline  
Old 12/10/2019, 15:34   #243
 
elite*gold: 0
Join Date: Feb 2014
Posts: 181
Received Thanks: 337
@ Death_Fire,

Ok, can you check two other things please. There should be another loot function that references this function, something like Loot() or Get_Loot, or PickupLoot. Post that function. Also, read your script down to where your bot makes it to the final waypoint coords and everyone is balled. After the Pop, you should see your PickUpLoot function called there, correct?
RiflemanX is offline  
Old 02/09/2020, 12:25   #244
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
Trying to use the new GWA2 to update some old bots but I always get a crash when the bot tries to initialize. The Character selector works fine, but then the client always crashes. I have tried all combinations of the arguments, and have also tried a couple of scripts that people uploaded and claimed it works for them, still crashing. I also re-downloaded the GW client. Any insight would be appreciated.
JohnyDee is offline  
Old 02/09/2020, 18:47   #245
 
phat34's Avatar
 
elite*gold: 0
Join Date: Sep 2014
Posts: 354
Received Thanks: 120
The main thing is people don't know how to track the errors... People that are interested in botting need to download Scite. Open the scripts in scite and learn to put information lines in their script.

Add lines like this in your script to isolate where the file is crashing, and if its a script error like Andy mentioned above (double functions, variables used without being declared, syntax errors) then scite will tell you what and where the errors are...Here is an informational line and you can duplicate them through your script to isolate where the crash is happening and come here with the information and then we can really help.

Code:
; add lines like this in the script so you can see it passed this point without crashing
ConsoleWrite("Passing Line 200 ..everything ok..")
; sometimes you might want to know the value of a variable...
ConsoleWrite("Injected with Character name " & $charname & '@'CRLF);
;remove quotes from '@'
phat34 is offline  
Old 02/09/2020, 23:19   #246
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
Hi Andy and Phat, I am sorry if I lead you to believe I was completely new to this. I have already cleaned the new GWA2, removed duplicate functions and added any missing ones. I have a very specific problem with the Initialize() function. When I run any script (either my own or any of the updated ones posted here the last couple of days) the client crashes at the initializing, i.e. the window does not get a new name, the crash window (prompting to send info to ArenaNet) pops up and when I press ok then the bot gui appears as normal. I have tried changing the arguments in the initialize() func (regarding eventmode, window rename etc) to any possible combination of True/Falses (as this sometimes caused crashes) but with no luck. I was wondering if there is anything else I am missing.
JohnyDee is offline  
Old 02/10/2020, 00:06   #247
 
Zvend's Avatar
 
elite*gold: 143
Join Date: Oct 2011
Posts: 72
Received Thanks: 31
Scite is terrible btw.
Maybe upload your Initialize function, so people here get actually a chance to help you
Zvend is offline  
Old 02/10/2020, 09:02   #248
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
This is the Initialize func from the newly released GWA2:

Code:
;~ Description: Injects GWA˛ into the game client.
Func Initialize($aGW, $bChangeTitle = True, $aUseStringLog = False, $aUseEventSystem = True)
	Local $lWinList, $lWinList2, $mGWProcessId
	$mUseStringLog = $aUseStringLog
	$mUseEventSystem = $aUseEventSystem

	If IsString($aGW) Then
		Local $lProcessList = ProcessList("gw.exe")
		For $i = 1 To $lProcessList[0][0]
			$mGWProcessId = $lProcessList[$i][1]
			$mGWWindowHandle = GetHwnd($mGWProcessId)
			MemoryOpen($mGWProcessId)
			If $mGWProcHandle Then
				If StringRegExp(ScanForCharname(), $aGW) = 1 Then ExitLoop
			EndIf
			MemoryClose()
			$mGWProcHandle = 0
		Next
	Else
		$mGWProcessId = $aGW
		$mGWWindowHandle = GetHwnd($mGWProcessId)
		MemoryOpen($aGW)
		ScanForCharname()
	EndIf

	If $mGWProcHandle = 0 Then Return 0

	Scan()

	Local $lTemp
	$mBasePointer = MemoryRead(GetScannedAddress('ScanBasePointer', 8)) ;-3
	SetValue('BasePointer', '0x' & Hex($mBasePointer, 8))
	$mAgentBase = GetScannedAddress('ScanAgentBase', -15) + 0x1E
	$mAgentBase = $mAgentBase + MemoryRead($mAgentBase) + 4
	$mAgentBase += 0x13
	$mAgentBase = MemoryRead($mAgentBase)
	SetValue('AgentBase', '0x' & Hex($mAgentBase, 8))
	$mMaxAgents = $mAgentBase + 8
	SetValue('MaxAgents', '0x' & Hex($mMaxAgents, 8))
	$mMyID = MemoryRead(GetScannedAddress('ScanMyID', -3));$mMyID = $mAgentBase - 84
	SetValue('MyID', '0x' & Hex($mMyID, 8))
	$mCurrentTarget = MemoryRead(GetScannedAddress('ScanCurrentTarget', -14)) ;$mAgentBase - 1280
	SetValue('PacketLocation', '0x' & Hex(MemoryRead(GetScannedAddress('ScanBaseOffset', 11)), 8))
	$mPing = MemoryRead(GetScannedAddress('ScanPing', -8))
	$mMapID = MemoryRead(GetScannedAddress('ScanMapID', 28))
	$mMapLoading = MemoryRead(GetScannedAddress('ScanMapLoading', 44))
	$mLoggedIn = MemoryRead(GetScannedAddress('ScanLoggedIn', -3)) - 0x198
	$mLanguage = MemoryRead(GetScannedAddress('ScanMapInfo', 11)) + 0xC
	$mRegion = $mLanguage + 4
	$mSkillBase = MemoryRead(GetScannedAddress('ScanSkillBase', 8))
	$mSkillTimer = MemoryRead(GetScannedAddress('ScanSkillTimer', -3))
	$lTemp = GetScannedAddress('ScanBuildNumber', 0x2C)
	$mBuildNumber = MemoryRead($lTemp + MemoryRead($lTemp) + 5)
	$mZoomStill = GetScannedAddress("ScanZoomStill", 0x33)
	$mZoomMoving = GetScannedAddress("ScanZoomMoving", 0x21)
	$mCurrentStatus = MemoryRead(GetScannedAddress('ScanChangeStatusFunction', 35))

	$lTemp = GetScannedAddress('ScanEngine', -0x6E) ;-16
	SetValue('MainStart', '0x' & Hex($lTemp, 8))
	SetValue('MainReturn', '0x' & Hex($lTemp + 5, 8))
	$lTemp = GetScannedAddress('ScanRenderFunc', -0x67)
    SetValue('RenderingMod', '0x' & Hex($lTemp, 8))
    SetValue('RenderingModReturn', '0x' & Hex($lTemp + 10, 8))
	$lTemp = GetScannedAddress('ScanTargetLog', 1)
	SetValue('TargetLogStart', '0x' & Hex($lTemp, 8))
	SetValue('TargetLogReturn', '0x' & Hex($lTemp + 5, 8))
	$lTemp = GetScannedAddress('ScanSkillLog', 1)
	SetValue('SkillLogStart', '0x' & Hex($lTemp, 8))
	SetValue('SkillLogReturn', '0x' & Hex($lTemp + 5, 8))
	$lTemp = GetScannedAddress('ScanSkillCompleteLog', -4)
	SetValue('SkillCompleteLogStart', '0x' & Hex($lTemp, 8))
	SetValue('SkillCompleteLogReturn', '0x' & Hex($lTemp + 5, 8))
	$lTemp = GetScannedAddress('ScanSkillCancelLog', 5)
	SetValue('SkillCancelLogStart', '0x' & Hex($lTemp, 8))
	SetValue('SkillCancelLogReturn', '0x' & Hex($lTemp + 6, 8))
	$lTemp = GetScannedAddress('ScanChatLog', 18)
	SetValue('ChatLogStart', '0x' & Hex($lTemp, 8))
	SetValue('ChatLogReturn', '0x' & Hex($lTemp + 6, 8))
	$lTemp = GetScannedAddress('ScanTraderHook', -7)
	SetValue('TraderHookStart', '0x' & Hex($lTemp, 8))
	SetValue('TraderHookReturn', '0x' & Hex($lTemp + 5, 8))

	$lTemp = GetScannedAddress('ScanDialogLog', -4)
	SetValue('DialogLogStart', '0x' & Hex($lTemp, 8))
	SetValue('DialogLogReturn', '0x' & Hex($lTemp + 5, 8))
	$lTemp = GetScannedAddress('ScanStringFilter1', -5); was -0x23
    SetValue('StringFilter1Start', '0x' & Hex($lTemp, 8))
    SetValue('StringFilter1Return', '0x' & Hex($lTemp + 5, 8))
    $lTemp = GetScannedAddress('ScanStringFilter2', 0x16); was 0x61
    SetValue('StringFilter2Start', '0x' & Hex($lTemp, 8))
    SetValue('StringFilter2Return', '0x' & Hex($lTemp + 5, 8))
    SetValue('StringLogStart', '0x' & Hex(GetScannedAddress('ScanStringLog', 0x16), 8))

	SetValue('LoadFinishedStart', '0x' & Hex(GetScannedAddress('ScanLoadFinished', 1), 8))
	SetValue('LoadFinishedReturn', '0x' & Hex(GetScannedAddress('ScanLoadFinished', 6), 8))

	SetValue('PostMessage', '0x' & Hex(MemoryRead(GetScannedAddress('ScanPostMessage', 11)), 8))
	SetValue('Sleep', MemoryRead(MemoryRead(GetValue('ScanSleep') + 8) + 3))
	SetValue('SalvageFunction', MemoryRead(GetValue('ScanSalvageFunction') + 8) - 18)
	SetValue('SalvageGlobal', MemoryRead(MemoryRead(GetValue('ScanSalvageGlobal') + 8) + 1))
	SetValue('IncreaseAttributeFunction', '0x' & Hex(GetScannedAddress('ScanIncreaseAttributeFunction', -0x5A), 8))
	SetValue("DecreaseAttributeFunction", "0x" & Hex(GetScannedAddress("ScanDecreaseAttributeFunction", 25), 8))
	SetValue('MoveFunction', '0x' & Hex(GetScannedAddress('ScanMoveFunction', 1), 8))
	SetValue('UseSkillFunction', '0x' & Hex(GetScannedAddress('ScanUseSkillFunction', -0x125), 8))
	SetValue('ChangeTargetFunction', '0x' & Hex(GetScannedAddress('ScanChangeTargetFunction', -15), 8))
	SetValue('WriteChatFunction', '0x' & Hex(GetScannedAddress('ScanWriteChatFunction', -0x3D), 8))
	SetValue('SellItemFunction', '0x' & Hex(GetScannedAddress('ScanSellItemFunction', -85), 8))
	SetValue('PacketSendFunction', '0x' & Hex(GetScannedAddress('ScanPacketSendFunction', -0xC2), 8))
	SetValue('ActionBase', '0x' & Hex(MemoryRead(GetScannedAddress('ScanActionBase', -3)), 8))
	SetValue('ActionFunction', '0x' & Hex(GetScannedAddress('ScanActionFunction', -3), 8))
	SetValue('UseHeroSkillFunction', '0x' & Hex(GetScannedAddress('ScanUseHeroSkillFunction', -0xA1), 8))
	SetValue('BuyItemBase', '0x' & Hex(MemoryRead(GetScannedAddress('ScanBuyItemBase', 15)), 8))
	SetValue('TransactionFunction', '0x' & Hex(GetScannedAddress('ScanTransactionFunction', -0x7E), 8))
	SetValue('RequestQuoteFunction', '0x' & Hex(GetScannedAddress('ScanRequestQuoteFunction', -0x34), 8)) ;-2
	SetValue('TraderFunction', '0x' & Hex(GetScannedAddress('ScanTraderFunction', -71), 8))
	SetValue('ClickToMoveFix', '0x' & Hex(GetScannedAddress("ScanClickToMoveFix", 1), 8))
	SetValue('ChangeStatusFunction', '0x' & Hex(GetScannedAddress("ScanChangeStatusFunction", 1), 8))

	SetValue('QueueSize', '0x00000010')
	SetValue('SkillLogSize', '0x00000010')
	SetValue('ChatLogSize', '0x00000010')
	SetValue('TargetLogSize', '0x00000200')
	SetValue('StringLogSize', '0x00000200')
	SetValue('CallbackEvent', '0x00000501')
	$MTradeHackAddress = GetScannedAddress("ScanTradeHack", 0)

	ModifyMemory()

	$mQueueCounter = MemoryRead(GetValue('QueueCounter'))
	$mQueueSize = GetValue('QueueSize') - 1
	$mQueueBase = GetValue('QueueBase')
	$mTargetLogBase = GetValue('TargetLogBase')
	$mStringLogBase = GetValue('StringLogBase')
	$mMapIsLoaded = GetValue('MapIsLoaded')
	$mEnsureEnglish = GetValue('EnsureEnglish')
	$mTraderQuoteID = GetValue('TraderQuoteID')
	$mTraderCostID = GetValue('TraderCostID')
	$mTraderCostValue = GetValue('TraderCostValue')
	$mDisableRendering = GetValue('DisableRendering')
	$mAgentCopyCount = GetValue('AgentCopyCount')
	$mAgentCopyBase = GetValue('AgentCopyBase')
	$mLastDialogID = GetValue('LastDialogID')

	If $mUseEventSystem Then MemoryWrite(GetValue('CallbackHandle'), $mGUI)

	DllStructSetData($mInviteGuild, 1, GetValue('CommandPacketSend'))
	DllStructSetData($mInviteGuild, 2, 0x4C)
	DllStructSetData($mUseSkill, 1, GetValue('CommandUseSkill'))
	DllStructSetData($mMove, 1, GetValue('CommandMove'))
	DllStructSetData($mChangeTarget, 1, GetValue('CommandChangeTarget'))
	DllStructSetData($mPacket, 1, GetValue('CommandPacketSend'))
	DllStructSetData($mSellItem, 1, GetValue('CommandSellItem'))
	DllStructSetData($mAction, 1, GetValue('CommandAction'))
	DllStructSetData($mToggleLanguage, 1, GetValue('CommandToggleLanguage'))

	DllStructSetData($mUseHeroSkill, 1, GetValue('CommandUseHeroSkill'))

	DllStructSetData($mBuyItem, 1, GetValue('CommandBuyItem'))
	DllStructSetData($mSendChat, 1, GetValue('CommandSendChat'))
	DllStructSetData($mSendChat, 2, $HEADER_SEND_CHAT)
	DllStructSetData($mWriteChat, 1, GetValue('CommandWriteChat'))
	DllStructSetData($mRequestQuote, 1, GetValue('CommandRequestQuote'))
	DllStructSetData($mRequestQuoteSell, 1, GetValue('CommandRequestQuoteSell'))
	DllStructSetData($mTraderBuy, 1, GetValue('CommandTraderBuy'))
	DllStructSetData($mTraderSell, 1, GetValue('CommandTraderSell'))
	DllStructSetData($mSalvage, 1, GetValue('CommandSalvage'))
	DllStructSetData($mIncreaseAttribute, 1, GetValue('CommandIncreaseAttribute'))
	DllStructSetData($mDecreaseAttribute, 1, GetValue('CommandDecreaseAttribute'))
	DllStructSetData($mMakeAgentArray, 1, GetValue('CommandMakeAgentArray'))
	DllStructSetData($mChangeStatus, 1, GetValue('CommandChangeStatus'))

	If $bChangeTitle Then WinSetTitle($mGWWindowHandle, '', 'Guild Wars - ' & GetCharname())
	Return $mGWWindowHandle
EndFunc   ;==>Initialize
I have tried using it either inside an EventHandler func or in the beginning of the script. Any time the script tries to inject, it crashes my GW client. The character name functions seem to work OK as the correct names appear in my gui, so perhaps it is something with the modifymemory() func...
JohnyDee is offline  
Old 02/10/2020, 14:23   #249
 
Zvend's Avatar
 
elite*gold: 143
Join Date: Oct 2011
Posts: 72
Received Thanks: 31
Ugh didnt look for a longer time into autoit code. You should try out the ISN Autoit Editor.
It offers a good debugger and you dont have to ConsoleWrite() every line to find out where the error is, lol.

Link:

i can help you more if you tell me where it gets stuck.
Zvend is offline  
Old 02/10/2020, 21:33   #250
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
No, I don't have any custom Initialize() func in my script that would call this (like the vaettir bot posted in the other thread). I just call the normal Initialize() func in a simple Eventhandler():

Code:
Func EventHandler()
	Switch (@GUI_CtrlId)
		Case $btnStart
			$boolRun = Not $boolRun
			If $boolRun Then
				GUICtrlSetData($btnStart, "Initializing...")
				GUICtrlSetState($btnStart, $GUI_DISABLE)
				Local $CharName = GUICtrlRead($Combo1)
				If $CharName = "" Then
					If Initialize(WinGetProcess("Guild Wars"), False, True, False) = False Then
						MsgBox(0, "Error", "Guild Wars it not running.")
						Exit
					EndIf
				  Else
					If Initialize($CharName, False, True, False) = False Then
						MsgBox(0, "Error", "Can't find a Guild Wars client with that character name.")
						Exit
					EndIf
				EndIf
				GUICtrlSetData($btnStart, "Stop")
				GUICtrlSetState($btnStart, $GUI_ENABLE)
			Else
				GUICtrlSetData($btnStart, "Continue")
			 EndIf
		Case $cbxHideGW
			If $mGWProcHandle <> 0 Then ToggleRendering()
		Case $GUI_EVENT_CLOSE
			If Not $Rendering Then ToggleRendering()
			Exit
	EndSwitch
EndFunc   ;==>EventHandler
I have also removed the togglerendering part as it is currently not functional. I have also tried the vaettir bot that I mentioned before (which is reported as working) and I get the same crash of gw client (again during the initialize). The bots don't crash and they don't present any issues (with missing globals or funcs etc), it is the actual game that crashes when GWA2 tries to inject itself. I am also using Windows 7 if that makes any difference (?). Thanks in advance for your input
JohnyDee is offline  
Old 02/11/2020, 03:13   #251
 
phat34's Avatar
 
elite*gold: 0
Join Date: Sep 2014
Posts: 354
Received Thanks: 120
For windows 7 try to add this line at the top of the file.

Code:
#RequireAdmin
You also may have some compatibility issues...or an older autoit version...
phat34 is offline  
Old 02/11/2020, 09:04   #252
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
Good point, I always run both gw and the script as admin just to avoid any such issues. I will check the autoit version, this could be it. I will also try running things in Win 10 (which I haven't done so far) in case it's the OS...


EDIT: It was the ******* outdated Autoit................
JohnyDee is offline  
Old 02/23/2020, 20:39   #253
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
Anyone got an example of an Assassin kill() function? I am having some trouble with the lead/second/third attack sequencing and getting the correct targets there... The sequence is the common jagged strike, fox fangs, death blossom.

Here is what I got so far but not working properly:

Code:
Func KillSin()
	While GetNumberOfFoesInRangeOfAgent(-2, 1250) > 0
		Local $jsOK = False
		Local $ffOK = False
		If GetIsDead(-2) Then Return
		If CheckEnchantments() Then
			TargetNearestEnemy()
			PingSleep()
			ChangeTarget(-1)
			PingSleep()
			If IsRecharged($js) And $jsOK = False And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
				Do
					If GetIsDead(-2) Then Return
					UseSkillEx($js, -1)
					PingSleep()
				Until GetSkillBarSkillRecharge($js) <> 0 ; ensure first attack
				$jsOK = True
				If IsRecharged($ff) And $jsOK = True And $ffOK = False And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
					Do
						If GetIsDead(-2) Then Return
						UseSkillEx($ff, -1)
						PingSleep()
					Until GetSkillBarSkillRecharge($ff) <> 0 ; ensure second attack
					$ffOK = True
					$jsOK = False
					If IsRecharged($db) And $ffOK = True And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
						Do
							If GetIsDead(-2) Then Return
							UseSkillEx($db, -1)
							PingSleep()
						Until GetSkillBarSkillRecharge($db) <> 0 ; ensure third attack
						$ffOK = False
					EndIf
				EndIf
			ElseIf GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
				Attack(-1)
				PingSleep()
			EndIf
		EndIf
	WEnd
EndFunc
JohnyDee is offline  
Old 02/24/2020, 18:03   #254
 
sadusten's Avatar
 
elite*gold: 0
Join Date: Aug 2015
Posts: 52
Received Thanks: 8
Quote:
Originally Posted by JohnyDee View Post
Anyone got an example of an Assassin kill() function? I am having some trouble with the lead/second/third attack sequencing and getting the correct targets there... The sequence is the common jagged strike, fox fangs, death blossom.

Here is what I got so far but not working properly:

Code:
Func KillSin()
	While GetNumberOfFoesInRangeOfAgent(-2, 1250) > 0
		Local $jsOK = False
		Local $ffOK = False
		If GetIsDead(-2) Then Return
		If CheckEnchantments() Then
			TargetNearestEnemy()
			PingSleep()
			ChangeTarget(-1)
			PingSleep()
			If IsRecharged($js) And $jsOK = False And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
				Do
					If GetIsDead(-2) Then Return
					UseSkillEx($js, -1)
					PingSleep()
				Until GetSkillBarSkillRecharge($js) <> 0 ; ensure first attack
				$jsOK = True
				If IsRecharged($ff) And $jsOK = True And $ffOK = False And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
					Do
						If GetIsDead(-2) Then Return
						UseSkillEx($ff, -1)
						PingSleep()
					Until GetSkillBarSkillRecharge($ff) <> 0 ; ensure second attack
					$ffOK = True
					$jsOK = False
					If IsRecharged($db) And $ffOK = True And GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
						Do
							If GetIsDead(-2) Then Return
							UseSkillEx($db, -1)
							PingSleep()
						Until GetSkillBarSkillRecharge($db) <> 0 ; ensure third attack
						$ffOK = False
					EndIf
				EndIf
			ElseIf GetAgentExists(-1) And DllStructGetData(GetAgentByID(-1), "HP") > 0 Then
				Attack(-1)
				PingSleep()
			EndIf
		EndIf
	WEnd
EndFunc
Try this one.

Code:
Func Killsin()
	Local $timerskills
	Local $ldistance

	While GetNumberOfFoesInRangeOfAgent(-2, 1250) > 0
		If GetIsDead(-2) Then ExitLoop
		If CheckEnchantments() Then
			TargetNearestEnemy()
			Sleep(getping() + 100)
			$ldistance = getdistance(-1, -2)
			If $ldistance > 100 Then             ;Moving up to foe
				attack(-1)
				Do
					Sleep(getping())
				Until $ldistance < 100
			EndIf
			Do
				If isrecharged($JS) Then
					If GetIsDead(-1) Then Return False
					$timerskills = TimerInit()
					useskill($JS, -1)
					Do
						Sleep(getping())
					Until Not isrecharged($JS) Or TimerDiff($timerskills) > 1250 Or GetIsDead(-1)
				EndIf
				If getisbleeding(-1) Then ;Making sure it hit him.
					If isrecharged($FF) Then
						If GetIsDead(-1) Then Return False
						$timerskills = TimerInit()
						useskill($FF, -1)
						Do
							Sleep(getping())
						Until Not isrecharged($FF) Or TimerDiff($timerskills) > 1250 Or GetIsDead(-1)
					EndIf
				EndIf
				If isrecharged($DB) Then
					If Not isrecharged($FF) Then ;Making sure FF has been used.
						If GetIsDead(-1) Then Return False
						$timerskills = TimerInit()
						useskill($DB, -1)
						Do
							Sleep(getping())
						Until Not isrecharged($DB) Or TimerDiff($timerskills) > 1250 Or GetIsDead(-1)
					EndIf
				EndIf
			Until GetIsDead(-1)
		EndIf
	WEnd
EndFunc   ;==>Killsin
sadusten is offline  
Thanks
1 User
Old 02/26/2020, 09:14   #255
 
elite*gold: 0
Join Date: Apr 2018
Posts: 38
Received Thanks: 4
Hi and thanks, it still does not work very well so I am trying different things. I also found this func from an old thread:

Code:
func canUseCombo($skill, $target)
	if not isDllStruct($target) then $target = getAgentByID($target)
	if not isDllStruct($skill) then $skill = getSkillById($skill)
	switch dllStructGetData($skill, "comboReq")
		case 1
			return dllStructGetData($target, "laststrike") = 3
		case 2
			return dllStructGetData($target, "laststrike") = 1
		case 4
			return dllStructGetData($target, "laststrike") = 2
	endSwitch
	return true
endFunc
but I am not exactly sure how it should be called in the fighting function...
JohnyDee is offline  
Reply


Similar Threads Similar Threads
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



All times are GMT +2. The time now is 16:19.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.