-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.au3
761 lines (617 loc) · 22.2 KB
/
main.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : #Region = ' & #Region & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
#AutoIt3Wrapper_Icon=lib\ico\icon.ico
#AutoIt3Wrapper_Compression=0
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$checkx64 = @AutoItX64
If $checkx64 = 1 Then
WinSetOnTop("Diablo III", "", 0)
MsgBox(0, "Erreur : ", "Script lancé en x64, merci de lancer en x86 ")
Terminate()
EndIf
$icon = @ScriptDir & "\lib\ico\icon.ico"
TraySetIcon($icon)
;;--------------------------------------------------------------------------------
;; Initialize MouseCoords
;;--------------------------------------------------------------------------------"
Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
;;--------------------------------------------------------------------------------
;; Initialize some Globals
;;--------------------------------------------------------------------------------
Global $GameOverTime,$GameFailed,$ClickToMoveToggle,$d3,$Step,$a_range,$ResActivated, _
$nb_die_t,$rdn_die_t,$ResLife,$Res_compt,$UsePath,$BanmonsterList,$File_Sequence,$TakeShrines
Global $Byte_NoItem_Identify,$Xp_Moy_Hrs, $ofs_objectmanager, $_MyGuid, $ofs_LocalActor_StrucSize, $_ActorAtrib_Count, _
$_ActorAtrib_4, $ofs_ActorAtrib_StrucSize, $GrabListTab, $ofs_LocalActor_atribGUID, _
$ofs_ActorDef, $ofs_MonsterDef, $_ofs_FileMonster_MonsterType, $_ofs_FileMonster_MonsterRace, _
$_ofs_FileMonster_LevelNormal, $_ofs_FileMonster_LevelNightmare, $_ofs_FileMonster_LevelHell, _
$_ofs_FileMonster_LevelInferno, $_defptr, $_defcount, $_deflink, $allSNOitems, $grablist, _
$Byte_Full_Inventory[2], $Byte_Full_Stash[2], $Byte_Boss_TpDeny[2]
; Variable global pour Automatisation des séquences
Global $Choix_Act_Run,$SequenceFileAct1,$SequenceFileAct2,$SequenceFileAct3,$Act1_Hero_Axe_Z,$Act2_Hero_Axe_Z
Global $Act3_Hero_Axe_Z,$Sequence_Aleatoire,$Nombre_de_Run,$NombreRun_Encour,$Act_Encour,$fileLog,$numLigneFichier
Global $NombreMiniAct1,$NombreMiniAct2,$NombreMiniAct3,$NombreMaxiAct1,$NombreMaxiAct2,$NombreMaxiAct3,$NombreDeRun
Global $ChainageActe[6][3]=[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
Global $ChainageActeEnCour[3],$ColonneEnCour,$NbreRunChangSeqAlea,$SequenceFileAct3PtSauve,$SequenceFileAct333,$SequenceFileAct362,$SequenceFileAct373
; Fin Variable global pour Automatisation des séquences
;Gestion des Skills suivant les Héros, de la difficulté et de la puissance des monstres
Global $Heros,$difficulte,$PuisMonstre,$TypedeBot,$TypeDeGrabList
;Gestion des Skills suivant les Héros
;Variable d'initialisation de la pause repas
Global $petitDejeunerOK=0,$dejeunerOK=0,$gouterOK=0,$dinerOK=0,$collationOK=0,$tempsPause
;global ajouter
Global $BreakCounter = 0
Global $CptElite=0,$ItemToRecycle=0,$ShrineTaken=0;global pour compter elite,item recyclé et Shrine
Global $nbRaresUnid=0,$nbRares=0,$nbLegs=0;global pour compter les items
Global $GoldBySale=0,$GoldByRepaire=0;global pour récupèré l'or
Global $tempsPauseGame=0,$tempsPauserepas=0;global pour récupèré temps de pause
Global $PauseRepasCounter=0,$BreakTimeCounter=0;global pour compter les pauses
Global $GOLDMOYbyHgame=0,$Xp_Moy_Hrsgame=0,$Xp_Moy_HrsPerte=0;globale pour xp et gold /heure temps de jeu
Global $dif_timer_stat_pause=0,$dif_timer_stat_game=0;global de temps de pause et temps de jeu
;fin global ajouter
Global $Hero_Axe_Z = 10
Global $Count_ACD = 0
Global $GetACD
Global $IgnoreItemList = ""
Global $nameCharacter
Global $timeforRightclick = 0
Global $timeForSpell1 = 0
Global $timeForSpell2 = 0
Global $timeForSpell3 = 0
Global $timeForSpell4 = 0
Global Const $PI = 3.141593
Global $Step = $PI / 6
Global $games = 1
Global $gamecounter = 0
Global $Try_ResumeGame = 0
Global $Try_Logind3 = 0
Global $disconnectcount = 0
Global $NeedRepairCount = 0
Global $Die2FastCount = 0
Global $timeforpotion = 0
Global $timeforclick = 0
Global $timeforskill = 0
Global $timedifmaxgamelength = 0
Global $timermaxgamelength = 0
Global $hotkeycheck = 0
Global $area = 0
Global $act = 0
Global $GameDifficulty = 0
Global $MP
Global $RepairTab = 0
Global $Paused
Global $GameOverTime = False
Global $DebugMessage
Global $fichierlog = "log-" & @YEAR & "_" & @MDAY & "_" & @MON & "_" & @HOUR & "h" & @MIN & ".txt"
Global $fichierstat = "stat_" & @YEAR & "_" & @MON & "_" & @MDAY & "-" & @HOUR & "h" & @MIN & ".txt"
Global $dif_timer_stat_formater = 0
Global $dif_timer_stat_moyen = 0
Global $Current_Hero_Z = 0
Local $posd3 = WinGetPos("Diablo III")
Global $grabskip = 0
Global $maxhp
Global $mousedownleft = 0
Global $spell_gestini_verif = 0
Global $elite = 0
Global $handle_banlist1 = ""
Global $handle_banlist2 = ""
Global $handle_banlistdef = ""
Global $Ban_startstrItemList = "barbarian_|Demonhunter_|Monk_|WitchDoctor_|WD_|Enchantress_|Scoundrel_|Templar_|Wizard_|monsterAffix_|Demonic_|Generic_|fallenShaman_fireBall_impact|demonFlyer_B_clickable_corpse_01|grenadier_proj_trail"
Global $Ban_endstrItemList = "_projectile"
Global $Ban_ItemACDCheckList = "a1_|a3_|a2_|a4_|Lore_Book_Flippy|Topaz_|Emeraude_|Rubis_|Amethyste_|healthPotion_Mythic|GoldCoins|GoldSmall|GoldMedium|GoldLarge"
$successratio = 1
$success = 0
$DebugX = $posd3[0] + $posd3[2] + 10
$DebugY = $posd3[1]
$Totalruns = 1
$Death = 0
$DeathCountToggle = True
$RepairORsell = 0
$ItemToStash = 0
$ItemToSell = 0
$GOLDInthepocket = 0
$GOLDINI = 0
$GOLD = 0
$GOLDMOY = 0
$LV=0
$EBP=0
$GF = 0
$MF = 0
$PR = 0
$MS = 0
$GameFailed = 0
$grabtimeout = 0
$killtimeout = 0
$SkippedMove = 0
$GOLDMOYbyH = 0
$dif_timer_stat = 0
$begin_timer_stat = 0
$timer_stat_total = 0
$timer_stat_run_moyen = 0
;var xp
$NiveauParagon = 0
$ExperienceNextLevel = 0
$Expencours = 0
$Xp_Total = 0
CheckWindowD3()
;;--------------------------------------------------------------------------------
;; Include some files
;;--------------------------------------------------------------------------------
#include "lib\sequence.au3"
#include "lib\settings.au3"
#include "lib\skills.au3"
#include "toolkit.au3"
#include "GDI_scene.au3"
#Include <WinAPI.au3>
; Automatisation des séquences
#include <File.au3>
#include "lib\GestionMenu.au3"
#include "lib\GestionPause.au3"
;;================================================================================
;; Set Some Hotkey
;;================================================================================
HotKeySet("{F2}", "Terminate")
HotKeySet("{F3}", "TogglePause")
;;--------------------------------------------------------------------------------
;; Initialize the offsets
;;--------------------------------------------------------------------------------
AdlibRegister("Die2Fast", 1200000)
offsetlist()
LoadingSNOExtended()
Func _dorun()
_log("======== new run ==========")
While Not offsetlist()
Sleep(40)
WEnd
If $GameFailed = 0 Then
$success += 1
EndIf
$successratio = $success / $Totalruns
$GameFailed = 0
$SkippedMove = 0
$IgnoreItemList = ""
StatsDisplay()
If $hotkeycheck = 0 Then
CheckHotkeys()
Auto_spell_init()
GestSpellInit()
Load_Attrib_GlobalStuff()
$maxhp = GetAttribute($_MyGuid, $Atrib_Hitpoints_Max_Total) ; dirty placement
_log("Max HP : " & $maxhp)
GetMaxResource($_MyGuid, $namecharacter)
Send("t")
sleep(500)
Detect_Str_full_inventory()
EndIf
GetAct()
Global $shrinebanlist = ""
EmergencyStopCheck()
If _checkRepair() Then
NeedRepair()
Else
$NeedRepairCount = 0
EndIf
Sleep(100)
enoughtPotions()
init_sequence()
sequence()
Global $shrinebanlist = ""
_log("End Run" & " gamefailled: " & $GameFailed)
Return True
EndFunc ;==>_dorun
Func _botting()
_log("Start Botting")
$bottingtime = TimerInit()
While 1
_log("new main loop")
offsetlist()
If _onloginscreen() Then
_log("LOGIN")
_logind3()
Sleep(Random(60000, 120000))
EndIf
;Lancement de la partie
; Si Choix_Act_Run <> 0 le bot passe en mode automatique
if $Choix_Act_Run<>0 Then
_gestionDesQuete()
EndIf
If _inmenu() And _onloginscreen() = False Then
RandSleep()
$DeathCountToggle = True
EndIf
;TCHAT
if($PartieSolo='false')Then
Switch Random(1,2,1)
Case 1
dialTchat("Bonjour c'est partie pour un run")
Case 2
dialTchat("Je vous souhaite LA bienvenuE")
EndSwitch
EndIf
_resumegame()
While _onloginscreen() = False And _ingame() = False
_log("Ingame False")
If _checkdisconnect() Then
$disconnectcount += 1
_log("Disconnected dc4")
Sleep(1000)
_randomclick(398, 349)
Sleep(1000)
While Not (_onloginscreen() Or _inmenu())
Sleep(Random(10000, 15000))
WEnd
ContinueLoop 2
EndIf
;TCHAT
if($PartieSolo='false')Then
Switch Random(1,2,1)
Case 1
dialTchat("En avant l'aventure")
Case 2
dialTchat("La chasse au montres est ouverte")
EndSwitch
EndIf
_resumegame()
WEnd
If _onloginscreen() = False And _playerdead() = False And _ingame() = True Then
Global $timermaxgamelength = TimerInit()
Global $GameOverTime = False
If _dorun() = True Then
$handle_banlist1 = ""
$handle_banlist2 = ""
$handle_banlistdef = ""
$Try_ResumeGame = 0
$Try_Logind3 = 0
$BreakCounter += 1;on ce met a compter les games avant la pause
$games += 1
$gamecounter += 1
EndIf
EndIf
If _onloginscreen() = False And _intown() = False And _playerdead() = False Then
GoToTown()
EndIf
_log("start GoToTown from main 2")
If _intown() Or _playerdead() And _onloginscreen() = False Then
If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1)) Then
StashAndRepair()
$games = 0
EndIf
If Not _checkdisconnect() Then
_leavegame()
Else
_log("Disconnected dc2")
$disconnectcount += 1
Sleep(1000)
_randomclick(398, 349)
_randomclick(398, 349)
EndIf
If _playerdead() Then
Sleep(Random(11000, 13000))
EndIf
EndIf
Sleep(1000)
_log('loop _inmenu() = False And _onloginscreen()')
While _inmenu() = False And _onloginscreen() = False
Sleep(10)
WEnd
WEnd
EndFunc ;==>_botting
Func MarkPos()
$currentloc = GetCurrentPos()
ConsoleWrite($currentloc[0] & ", " & $currentloc[1] & ", " & $currentloc[2] & ",1,25" & @CRLF);
EndFunc ;==>MarkPos
HotKeySet("{ù}", "MarkPos")
Func MonsterListing()
$Object = IterateObjectList(0)
$foundtarget = 0
ConsoleWrite("monster listing ===========================" & @CRLF)
For $i = 0 To UBound($Object, 1) - 1
_ArraySort($Object, 0, 0, 0, 8)
ConsoleWrite($Object[$i][2] & @CRLF)
If $Object[$i][1] <> 0xFFFFFFFF And $Object[$i][7] <> -1 And $Object[$i][8] < 100 Then
ConsoleWrite($Object[$i][2] & @CRLF)
EndIf
Next
EndFunc ;==>MonsterListing
HotKeySet("{µ}", "MonsterListing")
Func Testing_IterateObjetcsList()
Local $index, $offset, $count, $item[10]
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
for $i=0 to Ubound($item) - 1
_log($item[$i])
Next
$ACD = GetACDOffsetByACDGUID($item[0])
$CurrentIdAttrib = _memoryread($ACD + 0x120, $d3, "ptr");
$quality = GetAttribute($CurrentIdAttrib, $Atrib_Item_Quality_Level)
_log('quality : ' & $quality)
_log("--------")
_log("--------")
WEnd
EndFunc
Func Testing()
offsetlist()
GetRepairTab()
StashAndRepair()
EndFunc ;==>Testing
;###########################################################################
;###########################################################################
;###########################################################################
;###########################################################################
;###########################################################################
;###########################################################################
Global $Scene_table_totale[1][10]
Global $NavCell_table_totale[1][10]
Global $Scene_table_id_scene[1]
Func Read_Scene()
$nb_totale_scene_record = 0
$up = false
While 1
$ObManStoragePtr = _MemoryRead($ofs_objectmanager, $d3, "ptr")
$offset = $ObManStoragePtr + 0x794 + 0x178
$sceneCountPtr = _MemoryRead($offset, $d3, "ptr") + 0x108
$countScene = _MemoryRead($sceneCountPtr, $d3, "int")
$sceneFirstPtr = _MemoryRead($offset, $d3, "ptr") + 0x148
Dim $obj_scene[1][10]
$count = 0
;################################## ITERATION OBJ SCENE ########################################
for $i=0 to $countScene
$scenePtr = _MemoryRead($sceneFirstPtr, $d3, "ptr") + $i * 0x2A8
$temp_id_world = _MemoryRead ( $scenePtr + 0x008, $d3, "ptr") ;id world
$temp_id_scene = _MemoryRead ( $scenePtr, $d3, "ptr") ;id world
$correlation = true
If $temp_id_world = $_MyACDWorld AND $temp_id_scene <> 0xFFFFFFFF Then;id world
If $nb_totale_scene_record = 0 Then
$Scene_table_id_scene[0] = $temp_id_scene
$nb_totale_scene_record += 1
Else
for $a=0 to Ubound($Scene_table_id_scene) - 1
If $Scene_table_id_scene[$a] = $temp_id_scene Then
$correlation = false
ExitLoop
EndIf
Next
If $correlation = true Then
$Ucount=Ubound($Scene_table_id_scene)
Redim $Scene_table_id_scene[$Ucount+1]
$Scene_table_id_scene[$Ucount] = $temp_id_scene
EndIF
EndIF
If $correlation = true Then
$nb_totale_scene_record += 1
$count += 1
ReDim $obj_scene[$count][10]
$obj_scene[$count-1][0] = $temp_id_scene ;id_scene
$scenePtr += 0x004
$obj_scene[$count-1][1] = $temp_id_world ;id world
$obj_scene[$count-1][2] = _MemoryRead ( $scenePtr + 0x014, $d3, "int") ;sno_levelarea
$obj_scene[$count-1][3] = _MemoryRead ( $scenePtr + 0x0D8, $d3, "ptr") ;id_sno_scene
$obj_scene[$count-1][4] = _MemoryRead ( $scenePtr + 0x0EC, $d3, "float") ;Vec2 Meshmin x
$obj_scene[$count-1][5] = _MemoryRead ( $scenePtr + 0x0F0, $d3, "float") ;Vec2 Meshmin y
$obj_scene[$count-1][6] = _MemoryRead ( $scenePtr + 0x0F4, $d3, "float") ;Vec2 Meshmin z
$obj_scene[$count-1][7] = _MemoryRead ( $scenePtr + 0x164, $d3, "float") ;Vec2 Meshmax x
$obj_scene[$count-1][8] = _MemoryRead ( $scenePtr + 0x168, $d3, "float") ;Vec2 Meshmax y
$obj_scene[$count-1][9] = _MemoryRead ( $scenePtr + 0x16C, $d3, "float") ;Vec2 Meshmax z
ReDim $Scene_table_totale[$nb_totale_scene_record][10]
$Scene_table_totale[$nb_totale_scene_record-1][0] = $obj_scene[$count-1][0]
$Scene_table_totale[$nb_totale_scene_record-1][1] = $obj_scene[$count-1][1]
$Scene_table_totale[$nb_totale_scene_record-1][2] = $obj_scene[$count-1][2]
$Scene_table_totale[$nb_totale_scene_record-1][3] = $obj_scene[$count-1][3]
$Scene_table_totale[$nb_totale_scene_record-1][4] = $obj_scene[$count-1][4]
$Scene_table_totale[$nb_totale_scene_record-1][5] = $obj_scene[$count-1][5]
$Scene_table_totale[$nb_totale_scene_record-1][6] = $obj_scene[$count-1][6]
$Scene_table_totale[$nb_totale_scene_record-1][7] = $obj_scene[$count-1][7]
$Scene_table_totale[$nb_totale_scene_record-1][8] = $obj_scene[$count-1][8]
$Scene_table_totale[$nb_totale_scene_record-1][9] = $obj_scene[$count-1][9]
EndIf
EndIf
Next
;################################################################################################
Dim $list_sno_scene = IndexSNO(0x18EDF60,0)
;############################## ITERATION DU SNO ################################################
for $i=1 to Ubound($list_sno_scene) - 1
$correlation = false
$current_obj_scene = 0
for $x=0 To Ubound($obj_scene)-1
if $list_sno_scene[$i][1] = $obj_scene[$x][3] Then
$correlation = true
$current_obj_scene = $x
EndIf
Next
if $correlation Then
$NavMeshDef = $list_sno_scene[$i][0] + 0x040
$NavZoneDef = $list_sno_scene[$i][0] + 0x280
;############## ITERATION DES NAVCELL ################
$CountNavCell = _memoryRead($NavZoneDef, $d3, "int")
$NavCellPtr = _memoryRead($NavZoneDef + 0x08, $d3, "ptr")
If $CountNavCell <> 0 Then
Dim $Navcell_Table[$CountNavCell][9]
Local $NavCellStruct = DllStructCreate("float;float;float;float;float;float;short;short;int")
for $t=0 To $CountNavCell - 1
DllCall($d3[0], 'int', 'ReadProcessMemory', 'int', $d3[1], 'int', $NavCellPtr + ($t * 0x20), 'ptr', DllStructGetPtr($NavCellStruct), 'int', DllStructGetSize($NavCellStruct), 'int', '')
If Mod( DllStructGetData($NavCellStruct, 7) , 2) = 1 Then
$flag = 1
Else
$flag = 0
EndIf
If Ubound($NavCell_table_totale) - 1 = 0 AND $up = false Then
$up = true
Else
Redim $NavCell_table_totale[Ubound($NavCell_table_totale)+1][10]
EndIF
$num = Ubound($NavCell_table_totale)-1
$NavCell_Table_Totale[$num][0] = DllStructGetData($NavCellStruct, 1)
$NavCell_Table_Totale[$num][1] = DllStructGetData($NavCellStruct, 2)
$NavCell_Table_Totale[$num][2] = DllStructGetData($NavCellStruct, 3)
$NavCell_Table_Totale[$num][3] = DllStructGetData($NavCellStruct, 4)
$NavCell_Table_Totale[$num][4] = DllStructGetData($NavCellStruct, 5)
$NavCell_Table_Totale[$num][5] = DllStructGetData($NavCellStruct, 6)
$NavCell_Table_Totale[$num][6] = $flag
$NavCell_Table_Totale[$num][7] = DllStructGetData($NavCellStruct, 8)
$NavCell_Table_Totale[$num][8] = DllStructGetData($NavCellStruct, 9)
$NavCell_Table_Totale[$num][9] = $obj_scene[$current_obj_scene][0]
Next
Else
For $a=0 to Ubound($Scene_table_id_scene) -1
If $Scene_table_id_scene[$a] = $obj_scene[$current_obj_scene][0] Then
_ArrayDelete($Scene_table_id_scene, $a)
ExitLoop
EndIF
Next
For $a=0 To Ubound($Scene_table_totale) - 1
If $Scene_table_totale[$a][0] = $obj_scene[$current_obj_scene][0] Then
_Array2DDelete($Scene_table_totale, $a)
$nb_totale_scene_record -= 1
ExitLoop
EndIf
Next
EndIF
EndIf
Next
_log("fin Iteration")
sleep(500)
WEnd
EndFunc
Func Drawn()
_log("taille du tab Scene-> " & Ubound($Scene_table_totale))
_log("taille du tab NavCell-> " & Ubound($NavCell_Table_Totale))
;_ArrayDisplay($Scene_table_id_scene)
Dim $buffMax[2] = [0, 0]
Dim $buffMin[2] = [999999999, 99999999]
Dim $indexMax[2] = [0, 0] ; 0 -> Index MeshMax X le plus grand | 1 -> Index MEshMax Y le plus grand
Dim $indexMin[2] = [999999999, 99999999]
For $i=0 To Ubound($Scene_table_totale) - 1
if $buffMax[0] < $Scene_table_totale[$i][7] Then
$buffMax[0] = $Scene_table_totale[$i][7]
$indexMax[0] = $i
EndIF
if $buffMin[0] > $Scene_table_totale[$i][4] Then
$buffMin[0] = $Scene_table_totale[$i][4]
$indexMin[0] = $i
EndIf
If $buffMax[1] < $Scene_table_totale[$i][8] Then
$buffMax[1] = $Scene_table_totale[$i][8]
$indexMax[1] = $i
EndIf
if $buffMin[1] > $Scene_table_totale[$i][5] Then
$buffMin[1] = $Scene_table_totale[$i][5]
$indexMin[1] = $i
EndIf
Next
Initiate_GDIpicture($Scene_table_totale[$indexMax[1]][8] - $Scene_table_totale[$indexMin[1]][5], $Scene_table_totale[$indexMax[0]][7] - $Scene_table_totale[$indexMin[0]][4])
for $i=0 To Ubound($Scene_table_totale) - 1
for $y=0 To Ubound($NavCell_Table_Totale) - 1
If $Scene_table_totale[$i][0] = $NavCell_Table_Totale[$y][9] Then
;_arraydisplay($NavCell_Table_Totale)
$vx = ($Scene_table_totale[$i][4] - $Scene_table_totale[$indexMin[0]][4]) + $NavCell_Table_Totale[$y][0]
$vy = ($Scene_table_totale[$i][5] - $Scene_table_totale[$indexMin[1]][5]) + $NavCell_Table_Totale[$y][1]
;_log($i & "-" & $y)
;_arraydisplay($NavCell_Table_Totale)
$tx = $NavCell_Table_Totale[$y][3] - $NavCell_Table_Totale[$y][0]
$ty = $NavCell_Table_Totale[$y][4] - $NavCell_Table_Totale[$y][1]
$flag = $NavCell_Table_Totale[$y][6]
;_log($vx & " - " & $vy)
;_log($tx & " - " & $ty)
Draw_Nav($vy, $vx, $flag, $ty, $tx)
EndIF
Next
;Draw_Nav(($Scene_table_totale[$i][5] - $Scene_table_totale[$indexMin[1]][5]), ($Scene_table_totale[$i][4] - $Scene_table_totale[$indexMin[0]][4]), 3, $Scene_table_totale[$i][8] - $Scene_table_totale[$i][5], $Scene_table_totale[$i][7] - $Scene_table_totale[$i][4])
Next
Save_GDIpicture()
Load_GDIpicture()
EndFunc
HotKeySet("{F1}", "Testing")
HotKeySet("{F4}", "Testing_IterateObjetcsList")
HotKeyset("{F6}", "Read_Scene")
HotKeySet("{F7}", "Drawn")
If $Devmode <> "true" Then
_botting()
EndIf
While 1
WEnd
;;--------------------------------------------------------------------------------
;; Check KeyTo avoid sell of equiped stuff
;;--------------------------------------------------------------------------------
Func CheckHotkeys()
Sleep(2000)
Send("i")
Sleep(500)
If _checkInventoryopen() = False Then
WinSetOnTop("Diablo III", "", 0)
MsgBox(0, "Mauvais Hotkey", "La touche pour ouvrir l'inventaire doit être i" & @CRLF)
Terminate()
EndIf
Sleep(185)
Send("{SPACE}") ; make sure we close everything
Sleep(170)
If _checkInventoryopen() = True Then
WinSetOnTop("Diablo III", "", 0)
MsgBox(0, "Mauvais Hotkey", "La touche pour fermer les fenêtres doit être ESPACE" & @CRLF)
Terminate()
EndIf
ConsoleWrite("Check des touches OK" & @CRLF)
$hotkeycheck = 1
EndFunc ;==>CheckHotkeys
;;--------------------------------------------------------------------------------
;; Initialise Buffs while in training Area
;;--------------------------------------------------------------------------------
Func Buffinit()
If $delaiBuff1 Then
AdlibRegister("buff1", $delaiBuff1 * Random(1, 1.2))
EndIf
If $PreBuff1 = "true" Then
buff1()
Sleep(400)
EndIf
If $delaiBuff2 Then
AdlibRegister("buff2", $delaiBuff2 * Random(1, 1.2))
EndIf
If $PreBuff2 = "true" Then
buff2()
Sleep(400)
EndIf
If $delaiBuff3 Then
AdlibRegister("buff3", $delaiBuff3 * Random(1, 1.2))
EndIf
If $PreBuff3 = "true" Then
buff3()
Sleep(400)
EndIf
If $delaiBuff4 Then
AdlibRegister("buff4", $delaiBuff4 * Random(1, 1.2))
EndIf
If $PreBuff4 = "true" Then
buff4()
Sleep(400)
EndIf
EndFunc ;==>Buffinit
;;--------------------------------------------------------------------------------
;; Stop All buff timers
;;--------------------------------------------------------------------------------
Func UnBuff()
If $delaiBuff1 Then
AdlibUnRegister("buff1")
EndIf
If $delaiBuff2 Then
AdlibUnRegister("buff2")
EndIf
If $delaiBuff3 Then
AdlibUnRegister("buff3")
EndIf
If $delaiBuff4 Then
AdlibUnRegister("buff4")
EndIf
EndFunc ;==>UnBuff
Func buff1()
Send($ToucheBuff1)
EndFunc ;==>buff1
Func buff2()
Send($ToucheBuff2)
EndFunc ;==>buff2
Func buff3()
Send($ToucheBuff3)
EndFunc ;==>buff3
Func buff4()
Send($ToucheBuff4)
EndFunc ;==>buff4