How can i unequip an item without equipping another item instead?
Code:
Global Const $HEADER_ITEM_UNEQUIP = 0x52 ;Unequip item
Global Const $HEADER_ITEM_UNEQUIP = 0x52 ;Unequip item
Sorry, I am not able to help much at the moment but I can provide you this from gwapi. The structure looks correct but I do not think you can directly port this but it gives you an idea of what needs to be done.Quote:
How can i unequip an item without equipping another item instead?
Code:Global Const $HEADER_ITEM_UNEQUIP = 0x52 ;Unequip item
Func UnequipItem($aEquipmentSlot, $aBag, $aSlot) If IsPtr($aBag) Then $lBagID = MemoryRead($aBag + 8, 'long') ElseIf IsDllStruct($aBag) Then $lBagID = DllStructGetData($aBag, 'ID') Else $lBagID = MemoryRead(GetBagPtr($aBag) + 8, 'long') EndIf Return SendPacket(0x10, 0x49, $aEquipmentSlot - 1, $lBagID, $aSlot - 1) EndFunc ;==>UnequipItem
Func unequipitem($aequipmentslot, $abag, $aslot) If IsPtr($abag) Then $lbagid = memoryread($abag + 8, "long") ElseIf IsDllStruct($abag) Then $lbagid = DllStructGetData($abag, "ID") Else $lbagid = memoryread(getbagptr($abag) + 8, "long") EndIf Return sendpacket(16, $HEADER_ITEM_UNEQUIP, $aequipmentslot - 1, $lbagid, $aslot - 1) EndFunc
Quote:
Sorry, I am not able to help much at the moment but I can provide you this from gwapi. The structure looks correct but I do not think you can directly port this but it gives you an idea of what needs to be done.
In the above code these are the parameters:Code:Func UnequipItem($aEquipmentSlot, $aBag, $aSlot) If IsPtr($aBag) Then $lBagID = MemoryRead($aBag + 8, 'long') ElseIf IsDllStruct($aBag) Then $lBagID = DllStructGetData($aBag, 'ID') Else $lBagID = MemoryRead(GetBagPtr($aBag) + 8, 'long') EndIf Return SendPacket(0x10, 0x49, $aEquipmentSlot - 1, $lBagID, $aSlot - 1) EndFunc ;==>UnequipItem
Description: Unequips item to $abag, $aslot (1-based).
Equipmentslots:
1 -> Mainhand/Two-hand
2 -> Offhand
3 -> Chestpiece
4 -> Leggings
5 -> Headpiece
6 -> Boots
7 -> Gloves
Hope this helps.
Ok, there was another function in the Fiber Farmer. Try this one:
Notice that this one calls $Header_Item_Unequip so it will read off your current gwa2 headers.Code:Func unequipitem($aequipmentslot, $abag, $aslot) If IsPtr($abag) Then $lbagid = memoryread($abag + 8, "long") ElseIf IsDllStruct($abag) Then $lbagid = DllStructGetData($abag, "ID") Else $lbagid = memoryread(getbagptr($abag) + 8, "long") EndIf Return sendpacket(16, $HEADER_ITEM_UNEQUIP, $aequipmentslot - 1, $lbagid, $aslot - 1) EndFunc
Global Const $HEADER_ITEM_UNEQUIP = 0x54
Quote:
Hello i'm trying to make a global array with all the 1 point alcohol so i can use them with my Deldrimor skills and don't have to change the alcohol model id all the time i use:QUOTE
Global $OnePoint_Alcohol_Array[11] = [910, 5585, 6049, 6367, 6375, 15477, 19171, 19172, 19173, 22190, 28435] Global $ThreePoint_Alcohol_Array[7] = [2513, 6366, 24593, 30855, 31145, 31146, 35124] Global $FiftyPoint_Alcohol_Array[1] = [36682] Global Const $ITEM_ID_Hunters_Ale = 910 Global Const $ITEM_ID_Flask_of_Firewater = 2513 Global Const $ITEM_ID_Dwarven_Ale = 5585 Global Const $ITEM_ID_Witchs_Brew = 6049 Global Const $ITEM_ID_Spiked_Eggnog = 6366 Global Const $ITEM_ID_Vial_of_Absinthe = 6367 Global Const $ITEM_ID_Eggnog = 6375 Global Const $ITEM_ID_Bottle_of_Rice_Wine = 15477 Global Const $ITEM_ID_Zehtukas_Jug = 19171 Global Const $ITEM_ID_Bottle_of_Juniberry_Gin = 19172 Global Const $ITEM_ID_Bottle_of_Vabbian_Wine = 19173 Global Const $ITEM_ID_Shamrock_Ale = 22190 Global Const $ITEM_ID_Aged_Dwarven_Ale = 24593 Global Const $ITEM_ID_Hard_Apple_Cider = 28435 Global Const $ITEM_ID_Bottle_of_Grog = 30855 Global Const $ITEM_ID_Aged_Hunters_Ale = 31145 Global Const $ITEM_ID_Keg_of_Aged_Hunters_Ale = 31146 Global Const $ITEM_ID_Krytan_Brandy = 35124 Global Const $ITEM_ID_Battle_Isle_Iced_Tea = 36682
Quote:
Code:Global $OnePoint_Alcohol_Array[11] = [910, 5585, 6049, 6367, 6375, 15477, 19171, 19172, 19173, 22190, 28435] Global $ThreePoint_Alcohol_Array[7] = [2513, 6366, 24593, 30855, 31145, 31146, 35124] Global $FiftyPoint_Alcohol_Array[1] = [36682] Global Const $ITEM_ID_Hunters_Ale = 910 Global Const $ITEM_ID_Flask_of_Firewater = 2513 Global Const $ITEM_ID_Dwarven_Ale = 5585 Global Const $ITEM_ID_Witchs_Brew = 6049 Global Const $ITEM_ID_Spiked_Eggnog = 6366 Global Const $ITEM_ID_Vial_of_Absinthe = 6367 Global Const $ITEM_ID_Eggnog = 6375 Global Const $ITEM_ID_Bottle_of_Rice_Wine = 15477 Global Const $ITEM_ID_Zehtukas_Jug = 19171 Global Const $ITEM_ID_Bottle_of_Juniberry_Gin = 19172 Global Const $ITEM_ID_Bottle_of_Vabbian_Wine = 19173 Global Const $ITEM_ID_Shamrock_Ale = 22190 Global Const $ITEM_ID_Aged_Dwarven_Ale = 24593 Global Const $ITEM_ID_Hard_Apple_Cider = 28435 Global Const $ITEM_ID_Bottle_of_Grog = 30855 Global Const $ITEM_ID_Aged_Hunters_Ale = 31145 Global Const $ITEM_ID_Keg_of_Aged_Hunters_Ale = 31146 Global Const $ITEM_ID_Krytan_Brandy = 35124 Global Const $ITEM_ID_Battle_Isle_Iced_Tea = 36682
There are some scripts that target a boss or a healer in a group first. Think about what scripts might have this and look through the functions to see if there is something to help. I know Kilroy has something like this so you can try editing the below first.Quote:
hello, I have a coding problem in the function fight I want to make sure that the bot attack priority Forgotten Sage.and if there is not in the group he normally target. could you m ' please help? cordially
Func SelectTarget()
$target = GetCurrentTarget()
$Me = GetAgentByID(-2)
If $target <> 0 And DllStructGetData($target, 'Type') = 219 _
And DllStructGetData($target, 'Allegiance') = 3 And GetIsDead($target) = 0 Then
If TimerDiff($tSwitchtarget) < 1000 Or GetDistance($Me, $target) < 100 Then
Return DllStructGetData($target, 'Id')
Else
ConsoleWrite("Switching target, out of range!" & [MENTION=3576271]CRLF[/MENTION])
EndIf
EndIf
$tSwitchtarget = TimerInit()
Update("Looking for items")
PickupItems(1000)
Update("Selecting new target")
$kilroy = GetAgentById($kilroyID)
If GetIsDead($kilroy) Then
$target = GetNearestEnemyToAgent($meID)
ConsoleWrite("Kilroy is dead! Roaming!" & [MENTION=3576271]CRLF[/MENTION])
Else
$target = GetAgentByID(GetTarget($kilroy))
If $target = 0 Or GetIsDead($target) Or DllStructGetData($target, 'Allegiance') <> 3 Then
$possibletarget = GetNearestEnemyToAgent($kilroy)
If GetDistance($possibletarget, $kilroy) < 1250 Then
ConsoleWrite("Roaming!" & [MENTION=3576271]CRLF[/MENTION])
$target = $possibletarget
EndIf
Else
ConsoleWrite("Trying to copy target!" & [MENTION=3576271]CRLF[/MENTION])
EndIf
EndIf
If GetIsBoss($target) Then
;It's a boss, lets search for minions first!
$possibletarget = GetNearestEnemyToAgent($target)
If $possibletarget <> 0 And GetDistance($possibletarget, $kilroy) < 1250 Then
ConsoleWrite("Retargeting to minion!" & [MENTION=3576271]CRLF[/MENTION])
$target = $possibletarget
EndIf
EndIf
If $target <> 0 And GetIsDead($target) = 0 Then
$targetId = DllStructGetData($target, 'Id')
Update("Attacking " & $targetId)
ChangeTarget($target)
Sleep(GetPing())
Attack($target)
Return $targetId
EndIf
EndFunc ;==>SelectTarget
GetTraderCostValue()
1)Quote:
i have two questions:
First one: is there an list of all map ids? i am to lazy to create one ;)
Second: SetDisplayedTitle(0x29) change the displayed title to Norn. how can i find out for other titles? i dont find anything in the botdeveloper :/