Gestion Des Party (Invite/accepte/request)

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 :


Func AcceptParty($playername)
if clickUIitemValueVisible($playername,"right") = True then
clickUIitemVisible("Notification.PartyOkButton._icon_","left")
Endif
Endfunc

Func AskParty($playername)
send("o");open social
clickUIitemValueVisible($playername,"right")
clickUIitemVisible("PlayerContextMenuList.RequestToJoin","left")
send("o");close social
Endfunc

Func InviteParty($playername)
send("o");open social
clickUIitemValueVisible($playername,"right")
clickUIitemVisible("PlayerContextMenuList.InviteToParty","left")
send("o");close social
Endfunc

Func 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
Endfunc

Func 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
Salut Euclide,
wow génial !! J'en rêvais, dés que j'ai quelques heures devant moi j'essaye de tester ça et je te ferai un retour :).
Merci pour le travail et le partage :).
Woaaw, tu nous gâte!!

Avec ça on va passer sous le cap des 3h pour up lvl 60 :P
Salut,
je fais remonter pour demander si quelqu'un a finalement testé, je n'ai pas encore modifié les fichiers pour tester et je suis curieux de savoir comment ça fonctionne, merci pour vos retours :).
J'ai installer tout ça dans le toolkit mais je n'arrive pas a le faire fonctionner, je peut pas du coup te donner de retour concluant ^^
Des news pour ce sujet?
il semblerait que personne n'ait eu le temps de tester. Trop de changement avec la 1.0.8 et la v8. :)
y a des corrections a faire sur les offset :)
Je me doutais un peu que cetais pa a jour au vu de la 1.8