Le code est à améliorer et les fonctions à optimiser. Cela peut vous servir de base si vous souhaitez vous lancer dans l'adaptation d'un bot "follower"/"leader".
Si un joueur de votre friendlist s’appelle Plouf.
Pour inviter plouf
InviteParty("plouf")
Pour accepter une invitation de plouf
AcceptParty("plouf")
Pour demander a plouf de vous inviter
AskParty("plouf")
Fonctions a intégrer dans le toolkit si vous souhaitez tester :
Si un joueur de votre friendlist s’appelle Plouf.
Pour inviter plouf
InviteParty("plouf")
Pour accepter une invitation de plouf
AcceptParty("plouf")
Pour demander a plouf de vous inviter
AskParty("plouf")
Fonctions a intégrer dans le toolkit si vous souhaitez tester :
Func AcceptParty($playername)
if clickUIitemValueVisible($playername,"right") = True then
clickUIitemVisible("Notification.PartyOkButton._icon_","left")
Endif
EndfuncFunc AskParty($playername)
send("o");open social
clickUIitemValueVisible($playername,"right")
clickUIitemVisible("PlayerContextMenuList.RequestToJoin","left")
send("o");close social
EndfuncFunc InviteParty($playername)
send("o");open social
clickUIitemValueVisible($playername,"right")
clickUIitemVisible("PlayerContextMenuList.InviteToParty","left")
send("o");close social
EndfuncFunc clickUIitemValueVisible($valuetocheckfor,$button)
;output kinda buggy but does the job
;use for dev only
$ptr1 = _memoryread($ofs_objectmanager, $d3, "ptr")
$ptr2 = _memoryread($ptr1 + 2364, $d3, "ptr")
$ptr3 = _memoryread($ptr2 + 0, $d3, "ptr")
$ofs_uielements = _memoryread($ptr3 + 8, $d3, "ptr")
$uielementcount = _memoryread($ptr3 + 64, $d3, "int")
$counter = 0
While ($counter < $uielementcount)
$counter += 1
$uielemepointer = _memoryread($ofs_uielements + $counter * 4, $d3, "ptr")
While ($uielemepointer <> 0)
$npnt = _memoryread($uielemepointer + 528, $d3, "ptr")
$name = BinaryToString(_memoryread($npnt + 56, $d3, "byte[256]"), 4)
$uitextptr = _memoryread($npnt + 0xAE0, $d3, "ptr")
$uitext = BinaryToString(_memoryread($uitextptr, $d3, "byte[256]"), 4)
$visible = _memoryread($npnt + 40, $d3, "int")
If ($visible = 1) and StringInStr($uitext, $valuetocheckfor)<>0 Then
ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $valuetocheckfor & "="& $uitext )
ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $name)
$X = _memoryread($npnt + 0x508, $d3, "float") ;left
$Y = _memoryread($npnt + 0x50C, $d3, "float") ;top
$R = _memoryread($npnt + 0x510, $d3, "float") ;right
$B = _memoryread($npnt + 0x514, $d3, "float") ;bot
_log(" x :" & $X & " y :" & $Y & " R :" & $R & " B:" & $<img src='http://img.gmstemple.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />
$CoordsHeight = 600
$CoordsWidth = 800
$fourthreewidth = ($CoordsHeight/3)*4 ; // Coords.Height est la hauteur de la fenetre D3
$mb_ratio = 600/$CoordsHeight
$mb = ($CoordsWidth-$fourthreewidth)*$mb_ratio
$SX = ($X + $mb) / (1200/$CoordsHeight); // Position X par rapport a la fenetre
$SR = ($R + $mb) / (1200/$CoordsHeight)
$SY = $Y * ($CoordsHeight/1200);
$SB = ($B - 1) * ($CoordsHeight/1200)
$uiwidth = $SR - $SX
$uiheight = $SB - $SY
$UICenterX = $SX + ($uiwidth/2)
$UICenterY = $SY + ($uiheight/2)
MouseMove($UICenterX,$UICenterY) ; click on the center of the UI
MouseClick($button,$UICenterX,$UICenterY)
return true
EndIf
$uielemepointer = _memoryread($uielemepointer, $d3, "ptr")
WEnd
WEnd
Return false
EndfuncFunc clickUIitemVisible($valuetocheckfor,$button)
;output kinda buggy but does the job
;use for dev only
$ptr1 = _memoryread($ofs_objectmanager, $d3, "ptr")
$ptr2 = _memoryread($ptr1 + 2364, $d3, "ptr")
$ptr3 = _memoryread($ptr2 + 0, $d3, "ptr")
$ofs_uielements = _memoryread($ptr3 + 8, $d3, "ptr")
$uielementcount = _memoryread($ptr3 + 64, $d3, "int")
$counter = 0
While ($counter < $uielementcount)
$counter += 1
$uielemepointer = _memoryread($ofs_uielements + $counter * 4, $d3, "ptr")
While ($uielemepointer <> 0)
$npnt = _memoryread($uielemepointer + 528, $d3, "ptr")
$name = BinaryToString(_memoryread($npnt + 56, $d3, "byte[256]"), 4)
;$uitextptr = _memoryread($npnt + 0xAE0, $d3, "ptr")
;$uitext = BinaryToString(_memoryread($uitextptr, $d3, "byte[256]"), 4)
$visible = _memoryread($npnt + 40, $d3, "int")
If ($visible = 1) and StringInStr($name, $valuetocheckfor)<>0 Then
;ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $valuetocheckfor & "="& $uitext )
ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $name)
$X = _memoryread($npnt + 0x508, $d3, "float") ;left
$Y = _memoryread($npnt + 0x50C, $d3, "float") ;top
$R = _memoryread($npnt + 0x510, $d3, "float") ;right
$B = _memoryread($npnt + 0x514, $d3, "float") ;bot
_log(" x :" & $X & " y :" & $Y & " R :" & $R & " B:" & $<img src='http://img.gmstemple.com/public/style_emoticons/<#EMO_DIR#>/cool.gif' class='bbc_emoticon' alt='B)' />
$CoordsHeight = 600
$CoordsWidth = 800
$fourthreewidth = ($CoordsHeight/3)*4 ; // Coords.Height est la hauteur de la fenetre D3
$mb_ratio = 600/$CoordsHeight
$mb = ($CoordsWidth-$fourthreewidth)*$mb_ratio
$SX = ($X + $mb) / (1200/$CoordsHeight); // Position X par rapport a la fenetre
$SR = ($R + $mb) / (1200/$CoordsHeight)
$SY = $Y * ($CoordsHeight/1200);
$SB = ($B - 1) * ($CoordsHeight/1200)
$uiwidth = $SR - $SX
$uiheight = $SB - $SY
$UICenterX = $SX + ($uiwidth/2)
$UICenterY = $SY + ($uiheight/2)
MouseMove($UICenterX,$UICenterY) ; click on the center of the UI
MouseClick($button,$UICenterX,$UICenterY)
return
EndIf
$uielemepointer = _memoryread($uielemepointer, $d3, "ptr")
WEnd
WEnd
Endfunc
.