[Fonction] Resurection
#61
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
Posté 30 November 2012 - 10:58
#62
gmsMath
-
- Membres
-
- 981 messages
Fragger
- Location :Paris
- Hobbies :Voyages, Moto, calembour hilarant et gms temple :)
Posté 30 November 2012 - 15:50
Alors petit retour, la fonction fonctionne très bien, la modif pour rajouter une sécurité des réparations d'équipement n'est plus nécessaire, car le bug a été résolu (je l'avais bien détecté
) avec la mise à jour V6.01).
Par contre suite au modif, quand il va TP pour réparer suite à la fonction "repairafterXXXruns", le bot AFK en ville.
Alors soit c'est un bug, soit c'est moi qui ai merdouillé dans la modif du code, à vérifier.
J'ai eu le même soucis que toi, je blinde la fonction de log pour avoir plus d'infos et si je trouve une soluce je posterais
#63
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
Posté 30 November 2012 - 18:08
ajouter un sleep(3000) avant l’appelle a la boucle de l'offsetlist()
If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1)) Then
sleep(3000)
While Not offsetlist()
Sleep(10)
WEnd
- gmsMath aime ceci
#64
gmsMath
-
- Membres
-
- 981 messages
Fragger
- Location :Paris
- Hobbies :Voyages, Moto, calembour hilarant et gms temple :)
Posté 30 November 2012 - 18:38
Cherche pas plus loin -> offsetlist() qui merde ! (sujet évoquer dans le forum dev !)
ajouter un sleep(3000) avant l’appelle a la boucle de l'offsetlist()If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1)) Then sleep(3000) While Not offsetlist() Sleep(10) WEnd
Je test çà !!
Merci pour ton partage
#65
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
Posté 30 November 2012 - 19:34
#66
Toinou75
-
- Membres
-
- 803 messages
Fragger
- Location :Paris
- Hobbies :Modélisme, Informatique
Posté 30 November 2012 - 19:46
#67
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
#68
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
Posté 30 November 2012 - 20:05
a mon avis tu as oublié d’appelé init_sequence() dans le main mais bon, je dit sa, je dit rien hein ^^
#69
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
Posté 30 November 2012 - 20:08
j’hésite a mettre un sleep(10000) ^^
#70
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
#71
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
#72
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
Posté 30 November 2012 - 21:19
En fait c'est très aléatoire j'ai l'impression. Là, le bot vient de leave au lieu de rez.
#73
akasidjin
-
- Membres
-
- 18 messages
Newbie lvl 3
Posté 01 December 2012 - 07:30
c est normal ou c est moi ?
#74
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
Posté 01 December 2012 - 07:36
copie tout le code de tes fichiers entre des balises [ spoile ][ /spoile ]
a mon avis tu as oublié d’appelé init_sequence() dans le main mais bon, je dit sa, je dit rien hein ^^
#75
nuloseninformatique
-
- Membres
-
- 66 messages
Débutant lvl 2
Posté 01 December 2012 - 14:05
depuis la maj je peu meme faire boter mes feti en pm 1 / 2 / 4
#76
Metooyoo
-
- Membres
-
- 548 messages
*Zlatan*
Posté 01 December 2012 - 14:19
ca marche au top
depuis la maj je peu meme faire boter mes feti en pm 1 / 2 / 4
Salut, peux tu nous donner ton stuff, tes builds et stats dans le sujet adéquat ?
Sujet féticheur : https://forum.gmstem...showtopic=11882
Ce serait sympa pour tous les féticheurs ^^
Merci
- Toinou75 aime ceci
#77
Edhalis
-
- Membres
-
- 14 messages
Newbie lvl 3
Posté 01 December 2012 - 14:39
J'ai déjà tout repris depuis le début...
#78
Amonsaul
-
- Membres
-
- 10 messages
Newbie lvl 3
- Location :Montpellier
- Hobbies :Web, Jeux-video, Films
Posté 06 December 2012 - 18:54
Il y a quelques jours j'ai installé avec succès la version 6.01 qui marche nikel. Mon sorcier tient pas trop mal l'arma pm0 mais meurt de temps en temps, c'est pour ça que j'ai voulu installer la fonction résurection, et c'est là que les choses se compliquent... Je ne comprends pas, je sais que ça vient de moi, le tuto est très bien fait, et malgré ça je n'arrive pas à la faire fonctionner. J'ai pourtant tout repris de A à Z plusieurs fois je suis toujours dans l'impasse... Alors oui, je suis un total noob en la matière et c'est pour ça que je me suis décidé à poster.
Je pense avoir tout remplacé comme expliqué dans le tuto, et quand je me met à boter, tout marche bien (pas de message d'erreur), sauf que mon perso ne rez pas quand il meurt... il quitte et relance une partie. A noter que pour une raison obscure le décompte "nombre de résurrection" n'apparait pas dans les stats de droite (j'ai vérifié et revérifié, j'ai pourtant bien modifié la fonction StatsDisplay du toolkit.au3....
Je poste mes fichiers au cas où vous auriez un peu de temps à perdre et m'aider à trouver ce qui cloche :
sequence.au3
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
Func sequence()
dim $arr_seq1[100][5] = [[206.692764282227, 722.693603515625, -35.8240203857422,1,25], _
[327.7802734375, 722.134643554688, 0.100000239908695, 0, 25], _
[361.233367919922, 723.155029296875, 0.0999998897314072, 1, 25], _
[396.636413574219, 727.132934570313, 0.292241543531418, 1, 25], _
[432.108215332031, 727.035888671875, 0.100000008940697, 1, 25], _
[456.810638427734, 729.560546875, 0.100000239908695, 1, 25], _
[480.919036865234, 720.064331054688, 0.100016579031944, 1, 25], _
[513.213439941406, 722.520812988281, 0.425226032733917, 1, 25], _
[538.431396484375, 709.400390625, 0.526270031929016, 1, 25], _
[575.289001464844, 678.577880859375, 0.100015267729759,1,20], _
[564.48583984375, 683.751708984375, 0.100019082427025,1,20], _
[545.650268554688, 672.3134765625, 0.100015260279179, 1, 25], _
[539.451477050781, 619.96484375, 0.100015252828598, 1, 25], _
[576.119018554688, 570.673034667969, 0.100018046796322, 1, 25], _
[628.105224609375, 554.906677246094, 0.0998855605721474, 1, 25], _
[665.031372070313, 555.267944335938, 0.100015252828598, 1, 25], _
[719.467163085938, 548.17138671875, 0.100015260279179, 1, 25], _
[754.357421875, 562.712158203125, 0.100015260279179, 1, 25], _
[763.181457519531, 587.658752441406, 0.100015252828598, 1, 25], _
[782.532104492188, 639.928649902344, 0.10002288967371, 1, 25], _
[826.19873046875, 668.012878417969, 0.100015252828598, 1, 25], _
[865.750671386719, 706.178344726563, 0.100015267729759, 1, 25], _
[930.536315917969, 725.045166015625, 0.112262189388275, 1, 25], _
[969.425354003906, 721.049072265625, 0.10000005364418, 1, 25], _
[1019.24328613281, 721.808349609375, 0.100000001490116, 1, 25], _
[1053.24243164063, 710.680908203125, 0.0999999940395355, 1, 25], _
[1091.68542480469, 715.635681152344, 0.100002571940422, 1, 25], _
[1113.78527832031, 739.478576660156, 0.10000005364418, 1, 25], _
[1134.54772949219, 737.803466796875, 0.100000247359276, 1, 25], _
[1129.98010253906, 699.320434570313, 0.10000379383564, 1, 25], _
[1154.44641113281, 693.430969238281, 0.100000008940697, 1, 25]]
dim $arr_seq2[100][5] = [[3399.53051757813, 592.883728027344, 4.13610076904297, 1, 25], _
[3366.55126953125, 532.103759765625, 4.13610172271729, 1, 25], _
[3375.353515625, 480.171478271484, 4.13610172271729, 1, 25], _
[3403.6728515625, 444.356506347656, 4.13613319396973, 1, 25], _
[3429.77807617188, 411.916900634766, 4.23610067367554, 1, 25], _
[3468.111328125, 408.373016357422, 4.2361011505127, 1, 25], _
[3484.93579101563, 359.990142822266, 4.22556018829346, 1, 25], _
[3466.748046875, 308.676666259766, 4.17197513580322, 1, 25], _
[3437.67309570313, 291.675415039063, 4.13613271713257, 1, 25], _
[3406.36547851563, 244.697494506836, 4.13611698150635, 1, 25], _
[3388.49169921875, 200.068740844727, 4.23610258102417, 1, 25], _
[3350.751953125, 198.755294799805, 4.13610219955444, 1, 25], _
[3307.78100585938, 208.113327026367, 4.13610219955444, 1, 25], _
[3307.79125976563, 241.903762817383, 4.13610076904297, 1, 25], _
[3318.9599609375, 275.009155273438, 4.13610172271729, 1, 25], _
[3312.99609375, 311.989135742188, 4.13610124588013, 1, 25], _
[3288.59008789063, 344.426574707031, 4.1361026763916, 1, 25], _
[3257.61889648438, 373.536071777344, 4.13610076904297, 1, 25], _
[3240.26611328125, 407.972412109375, 4.13610029220581, 1, 25], _
[3217.18432617188, 441.216430664063, 4.1361026763916, 1, 25], _
[3190.22143554688, 473.004699707031, 4.1361026763916, 1, 25], _
[3135.6044921875, 461.222076416016, 4.13601922988892, 1, 25], _
[3097.26635742188, 472.799011230469, 4.13611936569214, 1, 25], _
[3030.88232421875, 477.130798339844, 4.13611888885498, 1, 25], _
[2968.85131835938, 483.541351318359, 4.13609933853149, 1, 25], _
[2917.94946289063, 488.521362304688, 4.13609886169434, 1, 25], _
[2886.7392578125, 516.322448730469, 4.13610076904297, 1, 25], _
[2886.50659179688, 558.705749511719, 4.13609886169434, 1, 25], _
[2883.32739257813, 600.420715332031, 4.13609838485718, 1, 25], _
[2882.255859375, 645.2822265625, 4.13609838485718, 1, 25], _
[2887.01318359375, 684.532897949219, 4.13609886169434, 1, 25], _
[2899.3046875, 716.864624023438, 4.13609933853149, 1, 25], _
[2921.9951171875, 739.088012695313, 4.13610076904297, 1, 25], _
[2951.82763671875, 755.687866210938, 4.13610076904297, 1, 25], _
[2979.94775390625, 765.159973144531, 4.13610124588013, 1, 25], _
[3014.10180664063, 769.427551269531, 4.13610076904297, 1, 25], _
[3054.04125976563, 766.797485351563, 4.13610076904297, 1, 25], _
[3096.26635742188, 764.203125, 4.13610029220581, 1, 25], _
[3136.11743164063, 755.73046875, 4.13610076904297, 1, 25], _
[3174.6708984375, 744.937744140625, 4.13610076904297, 1, 25], _
[3216.310546875, 738.722961425781, 4.13610029220581, 1, 25], _
[3254.8466796875, 729.619506835938, 4.13610076904297, 1, 25], _
[3294.07983398438, 719.999389648438, 4.13610029220581, 1, 25], _
[3332.939453125, 711.259643554688, 4.13610076904297, 1, 25], _
[3367.51147460938, 692.129089355469, 4.13610029220581, 1, 25], _
[3399.13647460938, 664.135131835938, 4.13610076904297, 1, 25], _
[3428.82641601563, 608.385925292969, 4.34261417388916, 1, 25], _
[3451.57177734375, 600.710083007813, 4.34298276901245, 1, 25]]
dim $arr_seq3[100][5] = [[1034.87683105469, 974.274597167969, -9.89999580383301,1,25], _
[1050.51672363281, 960.936279296875, -9.89999580383301,1,25], _
[1094.24975585938, 953.144287109375, -9.89999580383301,1,25], _
[1117.02392578125, 955.590881347656, -9.89999580383301,1,25], _
[1145.00964355469, 961.575256347656, -9.89999580383301,1,25], _
[1165.630859375, 983.526733398438, -9.89999580383301,1,25], _
[1182.31018066406, 1006.12457275391, -10.6088771820068,1,25], _
[1197.29956054688, 1026.62243652344, -19.8041534423828,1,25], _
[1223.38537597656, 1043.30065917969, -19.899995803833,1,25], _
[1252.603515625, 1049.03295898438, -19.8999996185303,1,25], _
[1275.02661132813, 1044.48864746094, -19.8999996185303,1,25], _
[1279.72912597656, 1075.57690429688, -19.3072338104248,1,25], _
[1250.63647460938, 1057.48840332031, -19.8999977111816,1,25], _
[1218.94616699219, 1082.34899902344, -19.8999977111816,1,25], _
[1202.55932617188, 1120.49279785156, -29.4506244659424,1,25], _
[1204.93212890625, 1153.86730957031, -29.9000015258789,1,25], _
[1218.45642089844, 1175.30676269531, -29.8126411437988,1,25], _
[1245.81555175781, 1193.84704589844, -29.2436428070068,1,25], _
[1225.37438964844, 1218.22961425781, -38.284839630127,1,25], _
[1194.29711914063, 1246.72497558594, -38.9255752563477,1,25], _
[1151.62231445313, 1264.8193359375, -39.4154205322266,1,25], _
[1109.62268066406, 1281.12841796875, -39.8999977111816,1,25], _
[1068.10583496094, 1280.99169921875, -39.0772972106934,1,25], _
[1028.46960449219, 1273.67138671875, -39.8134651184082,1,25], _
[997.777893066406, 1260.45288085938, -29.6894512176514,1,25], _
[958.253723144531, 1238.6318359375, -29.9000053405762,1,25], _
[945.312744140625, 1216.36499023438, -29.0591831207275,1,25], _
[956.874084472656, 1183.43566894531, -29.4052772521973,1,25], _
[979.314453125, 1158.69665527344, -29.8999996185303,1,25], _
[1013.87780761719, 1158.54309082031, -29.6089477539063,1,25], _
[1013.73992919922, 1190.357421875, -29.9000015258789,1,25], _
[983.1796875, 1162.912109375, -29.8999977111816,1,25], _
[949.358581542969, 1125.56713867188, -29.9000091552734,1,25], _
[956.013488769531, 1080.52478027344, -29.9000034332275,1,25], _
[967.2021484375, 1051.49743652344, -26.8313446044922,1,25], _
[970.408142089844, 1016.98254394531, -19.8999996185303,1,25], _
[922.792724609375, 988.321044921875, -19.8999977111816,1,25], _
[929.850280761719, 953.324462890625, -9.80142784118652,1,25], _
[953.000915527344, 925.924377441406, -9.89999866485596,1,25], _
[983.352233886719, 923.179504394531, -9.43467140197754,1,25], _
[998.278686523438, 963.086059570313, -9.65192985534668,1,25], _
[1022.95446777344, 982.567810058594, -9.89999580383301,1,25]]
dim $arr_seq4[100][5] = [[4252.0458984375, 4242.703125, -24.8396244049072,1,25], _
[4250.1376953125, 4191.8740234375, 0.24510583281517,1,25], _
[4229.40625, 4169.513671875, 0.100001908838749,1,25], _
[4222.91015625, 4123.77392578125, 0.100001253187656,1,25], _
[4212.46435546875, 4081.53466796875, 0.0999980941414833,1,25], _
[4212.63134765625, 4022.66479492188, 0.0999963134527206,1,25], _
[4184.828125, 3998.76147460938, 1.8944628238678,1,25], _
[4183.4951171875, 3941.2236328125, 2.27408933639526,1,25], _
[4187.76513671875, 3893.27685546875, 0.0999961942434311,1,25], _
[4199.54833984375, 3839.326171875, 0.0999986082315445,1,25], _
[4210.52978515625, 3791.49389648438, 0.100002340972424,1,25], _
[4211.35498046875, 3744.595703125, 0.0999982506036758,1,25], _
[4194.267578125, 3714.54760742188, 0.100000001490116,1,25], _
[4144.126953125, 3709.68334960938, 0.100003823637962,1,25], _
[4101.86181640625, 3715.70751953125, 0.100002840161324,1,25], _
[4042.62768554688, 3716.33764648438, 0.626998782157898,1,25], _
[4003.19360351563, 3712.587890625, 0.100000269711018,1,25], _
[3985.49340820313, 3695.56420898438, 0.634890794754028,1,25], _
[3979.74951171875, 3647.27905273438, 25.2451114654541,1,25], _
[3954.13354492188, 3648.37646484375, 25.2451114654541,1,25], _
[3953.35009765625, 3685.25024414063, 25.100004196167,1,25], _
[3933.74536132813, 3689.05541992188, 25.100004196167,1,25], _
[3872.54711914063, 3694.10400390625, 0.100007489323616,1,25], _
[3819.197265625, 3698.72265625, 0.10000191628933,1,25], _
[3746.89404296875, 3696.46044921875, 0.100001908838749,1,25], _
[3700.83129882813, 3697.83642578125, 0.100001908838749,1,25], _
[3678.98315429688, 3729.3740234375, 0.100001908838749,1,25], _
[3633.93115234375, 3733.4052734375, 0.100001908838749,1,25], _
[3598.82836914063, 3709.01342773438, 0.100002810359001,1,25], _
[3581.03344726563, 3693.62841796875, 0.604001343250275,1,25], _
[3538.04907226563, 3687.009765625, 25.3921966552734,1,25], _
[3479.11572265625, 3687.07055664063, 25.2734832763672,1,25], _
[3476.7353515625, 3637.62280273438, 0.34312841296196,1,25], _
[3498.64697265625, 3585.65771484375, 0.100001536309719,1,25], _
[3504.88793945313, 3534.78515625, 0.100000157952309,1,25], _
[3506.8369140625, 3481.26782226563, 0.140392303466797,1,25], _
[3506.2197265625, 3416.55590820313, 0.177977994084358,1,25], _
[3503.00366210938, 3364.47924804688, 0.0999999940395355,1,25], _
[3494.23388671875, 3300.23413085938, 0.110497012734413,1,25], _
[3496.8203125, 3241.52807617188, 0.100003816187382,1,25], _
[3462.17749023438, 3215.64038085938, 0.259606152772903,1,25], _
[3418.84130859375, 3219.62646484375, 0.100003242492676,1,25], _
[3361.68774414063, 3231.8681640625, 0.100003816187382,1,25], _
[3312.658203125, 3252.70776367188, 0.100000321865082,1,25], _
[3304.64306640625, 3324.10546875, 0.609894394874573,1,25], _
[3284.8486328125, 3320.59497070313, 0.754291892051697,1,25], _
[3251.10693359375, 3321.43237304688, 25.3957405090332,0,25], _
[3241.10302734375, 3319.12255859375, 25.2574119567871,0,25], _
[3198.982421875, 3306.99682617188, 25.2574119567871,1,25], _
[3169.17016601563, 3283.22827148438, 25.2574119567871,1,25], _
[3171.61669921875, 3241.39501953125, 25.2574119567871,1,25], _
[3176.05078125, 3182.93676757813, 0.308217287063599,1,25], _
[3215.38403320313, 3171.63598632813, 0.100001908838749,1,25], _
[3233.94213867188, 3127.21630859375, 0.100001476705074,1,25], _
[3241.56372070313, 3063.5615234375, 0.100001908838749,1,25], _
[3243.29467773438, 3018.99194335938, 0.100001141428947,1,25], _
[3245.21801757813, 2971.30834960938, 0.100001901388168,1,25], _
[3251.71704101563, 2926.2548828125, 0.0999980941414833,1,25], _
[3257.81713867188, 2874.84692382813, 0.099996417760849,1,25], _
[3265.20776367188, 2819.56030273438, 0.0999968647956848,1,25], _
[3264.55102539063, 2766.55395507813, 0.345846503973007,1,25], _
[3265.26586914063, 2723.29858398438, 0.319708853960037,1,25]]
bloc_sequence($arr_seq1)
TakeWP(2, 0, 4, 0) ;passage do core au field
bloc_sequence($arr_seq2)
TakeWP(3, 1, 4, 0) ;passage Tour des damnes
bloc_sequence($arr_seq3)
;TakeWP(0, 1, 4, 0) ;passage fort de pierre
;bloc_sequence($arr_seq4)
;Send('t')
TakeWP(0,0,3,4) ;Retour en ville
;#######################################################################
EndFunc ;==>Sequence
main.au3
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon= @ScriptDir & \lib\ico\icon.ico
$checkx64=@AutoItX64
if $checkx64=1 then
WinSetOnTop("Diablo III","",0)
MsgBox(0, "Erreur : ","Script lancé en x64, merci de lancer en x86 ")
Terminate()
Endif
Global $AttribInterop = ObjCreate("AttribVB.ClsAttribVB");
If Not @error Then
_log("Obj chargé")
Else
MsgBox(0, "Obj Test", "La dll n'est pas installé correctement.")
Terminate()
EndIf
$icon = @ScriptDir & "\lib\ico\icon.ico"
TraySetIcon($icon)
#include "sequence.au3"
CheckWindowD3()
;;--------------------------------------------------------------------------------
;; Initialize MouseCoords
;;--------------------------------------------------------------------------------
Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
;;--------------------------------------------------------------------------------
;; Initialize some Globals
;;--------------------------------------------------------------------------------
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 $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 $fichierstat = "stat_" & @YEAR & "_" & @MON & "_" & @MDAY & "-" & @HOUR & "h" & @MIN & ".txt"
Global $dif_timer_stat_formater = 0
Global $dif_timer_stat_moyen = 0
Local $posd3 = WinGetPos("Diablo III")
$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
$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
;;--------------------------------------------------------------------------------
;; Include some files
;;--------------------------------------------------------------------------------
#include "lib\settings.au3"
#include "toolkit.au3"
;;================================================================================
;; Set Some Hotkey
;;================================================================================
HotKeySet("{F2}", "Terminate")
HotKeySet("{F3}", "TogglePause")
;;--------------------------------------------------------------------------------
;; Initialize the offsets
;;--------------------------------------------------------------------------------
AdlibRegister("Die2Fast", 1200000)
offsetlist()
Func _dorun()
_log("======== new run ==========")
While Not offsetlist()
Sleep(40)
WEnd
$GameFailed = 0
$SkippedMove = 0
$IgnoreItemList = ""
StatsDisplay()
If $hotkeycheck = 0 Then
CheckHotkeys()
EndIf
GetAct()
Global $shrinebanlist = ""
EmergencyStopCheck()
If _checkRepair() Then
_log("Need repair")
$PortBack = False
$NeedRepairCount += 1
While Not _intown()
Attack($a_range, $monsterList)
Sleep(500)
$currentloc = getcurrentpos()
MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
If _playerdead() = False Then
_townportal()
Else
Return False
ExitLoop
EndIf
$PortBack = True
WEnd
While Not offsetlist()
Sleep(10)
WEnd
Sleep(Random(500, 1000))
Repair()
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(Random(100, 200))
If $PortBack Then
InteractByActorName('hearthPortal')
Sleep(Random(500, 1000))
While Not offsetlist()
Sleep(10)
WEnd
EndIf
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
If _inmenu() And _onloginscreen() = False Then
RandSleep()
$DeathCountToggle = True
_resumegame()
EndIf
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
_resumegame()
WEnd
If _onloginscreen() = False And _playerdead() = False And _ingame() = True Then
Global $timermaxgamelength = TimerInit()
Global $GameOverTime = False
If _dorun() = True Then
$games += 1
$gamecounter += 1
EndIf
EndIf
If _onloginscreen() = False And _intown() = False And _playerdead() = False Then
_log("start loop _onloginscreen() = False And _intown() = False And _playerdead() = False")
Local $nbTriesTownPortal = 0
While (_intown() = False And _inmenu() = False)
$nbTriesTownPortal += 1
Attack($a_range, $monsterList)
Sleep(500)
$currentloc = getcurrentpos()
MoveToPos($currentloc[0] + 5, $currentloc[1] + 5, $currentloc[2], 0, 6)
If $nbTriesTownPortal < 3 Then
_townportal()
Else
_leaveGame()
$nbTriesTownPortal = 0
Sleep(10000)
While _inmenu() = False
Sleep(10)
WEnd
ExitLoop
EndIf
If _playerdead() Then
_log("Player dead")
ExitLoop
EndIf
If _checkdisconnect() Then
_log("Disconnected dc1")
$disconnectcount += 1
Sleep(1000)
_randomclick(398, 349)
_randomclick(398, 349)
Sleep(1000)
While Not (_onloginscreen() Or _inmenu())
Sleep(Random(80000, 15000))
WEnd
ContinueLoop 2
EndIf
WEnd
RandSleep()
EndIf
If _intown() Or _playerdead() And _onloginscreen() = False Then
If _playerdead() = False And $games >= ($repairafterxxgames + Random(-2, 2, 1)) Then
While Not offsetlist()
Sleep(10)
WEnd
Sleep(Random(100, 200))
$RepairORsell += 1
_log('Filter Backpack')
$Items = FilterBackpack()
;Storage
$ToStash = _ArrayFindAll($Items, "Stash", 0, 0, 0, 1, 3)
If $ToStash <> -1 Then
Send("{SPACE}")
; MoveToPos(384.502319335938, 393.374298095703, 0.332142919301987, 0, 6)
Sleep(500)
InteractByActorName('Player_Shared_Stash')
Sleep(700)
Local $stashtry = 0
While _checkStashopen() = False
If $stashtry <= 4 Then
_log('Fail to open Stash')
$stashtry += 1
InteractByActorName("Player_Shared_Stash")
Sleep(Random(100, 200))
Else
Send("{PRINTSCREEN}")
Sleep(200)
Log('Failed to open Stash after 4 try')
WinSetOnTop("Diablo III", "", 0)
MsgBox(0, "Impossible d'ouvrir le stash :", "SVP, veuillez reporter ce problème sur le forum. Erreur : s001 ")
Terminate()
EndIf
WEnd
For $i = 0 To UBound($ToStash) - 1
_log($Items[$ToStash[$i]][0] & " stash : " & $Items[$ToStash[$i]][1])
Sleep(Random(100, 200))
InventoryMove($Items[$ToStash[$i]][0], $Items[$ToStash[$i]][1])
Sleep(Random(100, 500))
MouseClick('Right')
Sleep(Random(50, 200))
$ItemToStash = $ItemToStash + 1
Next
Sleep(Random(50, 100))
Send("{SPACE}")
Sleep(Random(100, 150))
EndIf
; MoveToPos(403.055877685547, 371.524749755859, 0.326129168272018, 0, 6)
; MoveToPos(443.109527587891, 331.811401367188, 0.498693227767944, 0, 6)
Sleep(Random(500, 1000))
Repair()
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(Random(100, 200))
;Trash
$ToTrash = _ArrayFindAll($Items, "Trash", 0, 0, 0, 1, 3)
If $ToTrash <> -1 Then
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(500)
InteractByActorName($RepairVendor)
Sleep(700)
Local $vendortry = 0
While _checkVendoropen() = False
If $vendortry <= 4 Then
_log('Fail to open vendor')
$vendortry = $vendortry + 1
InteractByActorName($RepairVendor)
Else
Send("{PRINTSCREEN}")
Sleep(200)
_log('Failed to open Vendor after 4 try')
WinSetOnTop("Diablo III", "", 0)
MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v002 ")
Terminate()
ExitLoop
EndIf
WEnd
For $i = 0 To UBound($ToTrash) - 1
InventoryMove($Items[$ToTrash[$i]][0], $Items[$ToTrash[$i]][1])
Sleep(Random(100, 500))
$ItemToSell = $ItemToSell + 1
MouseClick('Right')
Sleep(Random(100, 200))
Next
Sleep(Random(100, 200))
Send("{SPACE}")
Sleep(Random(100, 200))
EndIf
$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("MoveToPos(" & $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()
; kjInitMemPartialForAttributeReadingOnly($ofs_ObjectManager)
;_log(kjGetActorAttributeFast($_MyGuid,$Atrib_Alt_Level, 0xFFFFF, -1))
;_log(kjEnumActorAttributeFastSampleCode($_MyGuid))
;listuiitemvisible()
EndFunc ;==>Testing
HotKeySet("{F1}", "Testing")
If $Devmode <> "true" Then
_botting()
EndIf
While 1
WEnd
;;--------------------------------------------------------------------------------
;; Check KeyTo avoid sell of equiped stuff
;;--------------------------------------------------------------------------------
Func CheckHotkeys()
Sleep(1500)
Send("i")
Sleep(200)
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(150)
EndIf
If $delaiBuff2 Then
AdlibRegister("buff2", $delaiBuff2 * Random(1, 1.2))
EndIf
If $PreBuff2 = "true" Then
buff2()
Sleep(150)
EndIf
If $delaiBuff3 Then
AdlibRegister("buff3", $delaiBuff3 * Random(1, 1.2))
EndIf
If $PreBuff3 = "true" Then
buff3()
Sleep(150)
EndIf
If $delaiBuff4 Then
AdlibRegister("buff4", $delaiBuff4 * Random(1, 1.2))
EndIf
If $PreBuff4 = "true" Then
buff4()
Sleep(150)
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
toolkit
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
;;================================================================================
;;================================================================================
;; Diablo 3 Au3 ToolKit
;; Based on Unkn0wned, voxatu & the RE community works
;;
;; By Opkllhibus, Leo11173
;;================================================================================
;;================================================================================
;;================================================================================
;; PRE FUNCTIONS
;;================================================================================
;;--------------------------------------------------------------------------------
;; Make sure you are running as admin
;;--------------------------------------------------------------------------------
$_debug = 1
#RequireAdmin
$Admin = IsAdmin()
If $Admin <> 1 Then
MsgBox(0x30, "ERROR", "This program require administrative rights you fool!")
Exit
EndIf
Global $hDll = DllOpen("ntdll.dll")
Func _HighPrecisionSleep($iMicroSeconds)
Local $hStruct
$hStruct = DllStructCreate("int64 time;")
DllStructSetData($hStruct, "time", -1 * ($iMicroSeconds * 10))
DllCall($hDll, "dword", "ZwDelayExecution", "int", 0, "ptr", DllStructGetPtr($hStruct))
EndFunc ;==>_HighPrecisionSleep
;;--------------------------------------------------------------------------------
;; Includes
;;--------------------------------------------------------------------------------
#include "lib\NomadMemory.au3" ;THIS IS EXTERNAL, GET IT AT THE AUTOIT WEBSITE
#include <math.au3>
#include <String.au3>
#include <Array.au3>
#include "lib\constants.au3"
;;--------------------------------------------------------------------------------
;; Initialize MouseCoords
;;--------------------------------------------------------------------------------
Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client
Opt("SendKeyDownDelay", 80)
;;--------------------------------------------------------------------------------
;; Open the process
;;--------------------------------------------------------------------------------
Opt("WinTitleMatchMode", -1)
SetPrivilege("SeDebugPrivilege", 1)
Global $ProcessID = WinGetProcess("[CLASS:D3 Main Window Class]", "")
Local $d3 = _MemoryOpen($ProcessID)
If @error Then
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)
MsgBox(4096, "ERROR", "Failed to open memory for process;" & $ProcessID)
Exit
EndIf
;OffsetList()
;;================================================================================
;; FUNCTIONS
;;================================================================================
;;--------------------------------------------------------------------------------
; Function: init_sequence() & bloc_sequence(ByRed $arr_MTP)
; Description:
;
;;--------------------------------------------------------------------------------
Func init_sequence()
$nb_die_t = 0
$rdn_die_t = $ResLife + Random(-1, 1, 1)
_log("New sequence, max death allowed :" & $rdn_die_t)
EndFunc
Func bloc_sequence(ByRef $arr_MTP)
If IsArray($arr_MTP) Then
Sleep(Random(500, 1000))
Buffinit()
For $i = 0 To UBound($arr_MTP, 1) - 1
If $arr_MTP[$i][0] <> 0 Then
MoveToPos($arr_MTP[$i][0], $arr_MTP[$i][1], $arr_MTP[$i][2], $arr_MTP[$i][3], $arr_MTP[$i][4])
If _playerdead_revive() then
$nb_die_t = $nb_die_t + 1
$Res_compt = $Res_compt + 1
_log("You are dead, max :" & $rdn_die_t - $nb_die_t & " more death allowed")
If $nb_die_t <= $rdn_die_t Then
Sleep(Random(5000, 6000))
MouseClick("left", 400, 470, 1, 6)
Sleep(Random(750, 1000))
bloc_sequence($arr_MTP)
return
Else
_log("You have reached the max number of revive : " & $rdn_die_t)
EndIf
EndIf
EndIf
Next
Unbuff()
Sleep(Random(500, 1000))
Else
_log("Invalid sequence array argument")
EndIf
EndFunc
Func _logind3()
WinActivate("[CLASS:D3 Main Window Class]")
_log("Login")
Sleep(20)
Send($d3pass)
Sleep(2000)
Send("{ENTER}")
Sleep(Random(5000, 6000, 1))
EndFunc ;==>_logind3
Func CheckWindowD3()
If WinExists("[CLASS:D3 Main Window Class]") Then
WinActivate("[CLASS:D3 Main Window Class]")
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 1)
Sleep(300)
Else
MsgBox(0,Default,"Fenêtre Diablo III absente.")
Terminate()
EndIf
Global $sized3 = WinGetClientSize("[CLASS:D3 Main Window Class]")
If $sized3[0] <> 800 Or $sized3[1] <> 600 Then
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)
MsgBox(0,Default, "Erreur Dimension : Il faut être en 800 x 600 et non pas en " & $sized3[0] & " x " & $sized3[1] & ".")
Terminate()
Else
_log("Setting Window Diablo III OK")
EndIf
EndFunc ;==>CheckWindowD3
;;--------------------------------------------------------------------------------
; Function: FindActor()
; Description: Check if an actor is present or not
;
; Note(s): Return 1 if found in range or 0 if absent
;;--------------------------------------------------------------------------------
Func FindActor($name, $maxRange = 400)
Local $index, $offset, $count, $item[10], $find = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], $name) And $item[9] < $maxRange Then
$find = 1
Return 1
ExitLoop
EndIf
WEnd
If $find = 0 Then SetError(1)
Return 0
EndFunc ;==>FindActor
;;--------------------------------------------------------------------------------
; Function: checkuiitemvisible()
; Description: search a value in the object manager
;;--------------------------------------------------------------------------------
Func checkuiitemvisible($valuetocheckfor, $visibility)
$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)
$visible = _memoryread($npnt + 40, $d3, "int")
If ($visible = $visibility) Then
$foundvalue = StringInStr($name, $valuetocheckfor)
If ($foundvalue >= 1) Then
Return True
EndIf
EndIf
$uielemepointer = _memoryread($uielemepointer, $d3, "ptr")
WEnd
WEnd
Return False
EndFunc ;==>checkuiitemvisible
Func listuiitemvisible()
;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[1024]"), 4)
$visible = _memoryread($npnt + 40, $d3, "int")
If ($visible = 1) Then
ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $uitext)
ConsoleWrite(@CRLF & "count aka bucket: " & $counter & " " & $name)
EndIf
$uielemepointer = _memoryread($uielemepointer, $d3, "ptr")
WEnd
WEnd
EndFunc ;==>listuiitemvisible
Func fastcheckuiitemvisible($valuetocheckfor, $visibility, $bucket)
$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")
$uielementpointer = _memoryread($ofs_uielements + 4 * $bucket, $d3, "ptr")
While $uielementpointer <> 0
$npnt = _memoryread($uielementpointer + 528, $d3, "ptr")
$name = BinaryToString(_memoryread($npnt + 56, $d3, "byte[256]"), 4)
If StringInStr($name, $valuetocheckfor) Then
If _memoryread($npnt + 40, $d3, "int") = $visibility Then
Return True
Else
Return False
EndIf
EndIf
$uielementpointer = _memoryread($uielementpointer, $d3, "ptr")
WEnd
Return False
EndFunc ;==>fastcheckuiitemvisible
;;--------------------------------------------------------------------------------
; Function: fastCheckuiValue()
; Description: Get value of an UI element
;
; Note(s): Return checked UI value or return Fasle
;;--------------------------------------------------------------------------------
func fastCheckuiValue($valuetocheckfor, $visibility, $bucket)
$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")
$uielementpointer = _memoryread($ofs_uielements + 4 * $bucket, $d3, "ptr")
While $uielementpointer <> 0
$npnt = _memoryread($uielementpointer + 528, $d3, "ptr")
$name = BinaryToString(_memoryread($npnt + 56, $d3, "byte[1024]"), 4)
If StringInStr($name, $valuetocheckfor) Then
If _memoryread($npnt + 40, $d3, "int") = $visibility Then
$uitextptr = _memoryread($npnt + 0xAE0, $d3, "ptr")
$uitext = BinaryToString(_memoryread($uitextptr, $d3, "byte[1024]"),4)
ConsoleWrite(@CRLF & $uitext)
Return $uitext
Else
_log($valuetocheckfor & " is invisible")
Return False
EndIf
EndIf
$uielementpointer = _memoryread($uielementpointer, $d3, "ptr")
WEnd
_log($valuetocheckfor & " not found")
Return False
Endfunc ;==>fastCheckuiValue
Func _playerdead()
$playerdeadlookfor = "NormalLayer.deathmenu_dialog"
$return = fastcheckuiitemvisible($playerdeadlookfor, 1, 969)
If ($return And $DeathCountToggle) Then
$Death += 1
$Die2FastCount += 1
$DeathCountToggle = False
EndIf
Return $return
EndFunc ;==>_playerdead
Func _playerdead_revive()
If($ResActivated) Then
If $nb_die_t > $rdn_die_t Then ;Si on a deja depassé le nombre de revive autorisé, on renvoie forcement false, pour ne plus utiliser cette fonction
return False
EndIf
$playerdeadlookfor = "NormalLayer.deathmenu_dialog"
$return = fastcheckuiitemvisible($playerdeadlookfor, 1, 969)
return $return
EndIf
return false
EndFunc ;==>_playerdead_revive
Func _inmenu()
$lobbylookfor = "Menu.PlayGameButton"
Return fastcheckuiitemvisible($lobbylookfor, 1, 654)
EndFunc ;==>_inmenu
Func _checkdisconnect()
$disclookfor = "Root.TopLayer.BattleNetModalNotifications_main.ModalNotification.Buttons.ButtonList.OkButton"
Return fastcheckuiitemvisible($disclookfor, 1, 1073)
EndFunc ;==>_checkdisconnect
Func _checkRepair()
$replookfor = "Root.NormalLayer.DurabilityIndicator"
Return fastcheckuiitemvisible($replookfor, 1, 239)
EndFunc ;==>_checkRepair
Func _onloginscreen()
$loginlookfor = "Root.NormalLayer.BattleNetLogin_main.LayoutRoot"
Return fastcheckuiitemvisible($loginlookfor, 1, 174)
EndFunc ;==>_onloginscreen
Func _escmenu()
$escmenuelookfor = "Root.TopLayer.gamemenu_dialog.gamemenu_bkgrnd.ButtonStackContainer.button_leaveGame"
Return fastcheckuiitemvisible($escmenuelookfor, 1, 1447)
EndFunc ;==>_escmenu
Func _ingame()
$gamelookfor = "game_progressBar_healthBall"
Return fastcheckuiitemvisible($gamelookfor, 1, 237)
EndFunc ;==>_ingame
Func _checkWPopen()
$checkWPopenlookfor = "Root.NormalLayer.waypoints_dialog_mainPage"
Return fastcheckuiitemvisible($checkWPopenlookfor, 1, 1398)
EndFunc ;==>_checkWPopen
Func _checkVendoropen()
$checkVendorOpenlookfor = "Root.NormalLayer.shop_dialog_mainPage"
Return fastcheckuiitemvisible($checkVendorOpenlookfor, 1, 1814)
EndFunc ;==>_checkVendoropen
Func _checkStashopen()
$_checkStashopenlookfor = "Root.NormalLayer.stash_dialog_mainPage"
Return fastcheckuiitemvisible($_checkStashopenlookfor, 1, 1291)
EndFunc ;==>_checkStashopen
Func _checkInventoryopen()
$_checkInventoryopenlookfor = "Root.NormalLayer.inventory_dialog_mainPage"
Return fastcheckuiitemvisible($_checkInventoryopenlookfor, 1, 1622)
EndFunc ;==>_checkInventoryopen
Func _townportal()
_log("Town Portal")
If _playerdead() = False Then
Sleep(200)
Send("t")
Sleep(Random(8000, 8500, 1))
Else
_log("No TP Cuz Your dead allready
EndIf
EndFunc ;==>_townportal
;;--------------------------------------------------------------------------------
; Function: IsInArea($area)
; Description: Check where we are
;
;;--------------------------------------------------------------------------------
Func IsInArea($area)
$area = GetLevelAreaId()
ConsoleWrite("Area " & $area & @CRLF)
Return $area = GetLevelAreaId()
EndFunc ;==>IsInArea
Func GetLevelAreaId()
;Return _MemoryRead(_MemoryRead(0x17E05A4, $d3, "int") + 0x40, $d3, "int")
Return _MemoryRead(_MemoryRead(0x17E3F14, $d3, "int") + 0x40, $d3, "int")
EndFunc ;==>GetLevelAreaId
Func LevelAreaConstants()
Global $A1_C6_SpiderCave_01_Entrance = 0xE3A6
Global $A1_C6_SpiderCave_01_Main = 0x132EC
Global $A1_C6_SpiderCave_01_Queen = 0xF506
Global $A1_Dun_Crypt_Dev_Hell = 0x36581
Global $A1_Fields_Cave_SwordOfJustice_Level01 = 0x1D455
Global $A1_Fields_Den = 0x21045
Global $A1_Fields_Den_Level02 = 0x2F6b8
Global $A1_Fields_RandomDRLG_CaveA_Level01 = 0x141C4
Global $A1_Fields_RandomDRLG_CaveA_Level02 = 0x141C5
Global $A1_Fields_RandomDRLG_ScavengerDenA_Level01 = 0x13D0D
Global $A1_Fields_RandomDRLG_ScavengerDenA_Level02 = 0x13D17
Global $A1_Fields_Vendor_Tinker_Exterior = 0x2bC0C
Global $A1_Highlands_RandomDRLG_GoatmanCaveA_Level01 = 0x14286
Global $A1_Highlands_RandomDRLG_GoatmanCaveA_Level02 = 0x14287
Global $A1_Highlands_RandomDRLG_WestTower_Level01 = 0x14196
Global $A1_Highlands_RandomDRLG_WestTower_Level02 = 0x14197
Global $A1_Random_Level01 = 0x33A17
Global $A1_trDun_Blacksmith_Cellar = 0x144A6
Global $A1_trDun_ButchersLair_02 = 0x16301
Global $A1_trDun_Cain_Intro = 0xED2A
Global $A1_trDun_Cave_Highlands_Random01_VendorRescue = 0x21310
Global $A1_trdun_Cave_Nephalem_01 = 0xEBEC
Global $A1_trdun_Cave_Nephalem_02 = 0xEBED
Global $A1_trdun_Cave_Nephalem_03 = 0xEBEE
Global $A1_trDun_Cave_Old_Ruins_Random01 = 0x278AC
Global $A1_trDun_CrownRoom = 0x18FDA
Global $A1_trDun_Crypt_Event_Tower_Of_Power = 0x138F4
Global $A1_trDun_Crypt_Flooded_Memories_Level01 = 0x18F9c
Global $A1_trDun_Crypt_Flooded_Memories_Level02 = 0x287A6
Global $A1_trdun_Crypt_Special_00 = 0x25BDC
Global $A1_trdun_Crypt_Special_01 = 0xECB9
Global $A1_trDun_Event_JarOfSouls = 0x2371E
Global $A1_trDun_FalseSecretPassage_01 = 0x14540
Global $A1_trDun_FalseSecretPassage_02 = 0x14541
Global $A1_trDun_FalseSecretPassage_03 = 0x14542
Global $A1_trDun_Jail_Level01 = 0x171d0
Global $A1_trDun_Jail_Level01_Cells = 0x1783D
Global $A1_trDun_Leoric01 = 0x4D3E
Global $A1_trDun_Leoric02 = 0x4D3F
Global $A1_trDun_Leoric03 = 0x4D40
Global $A1_trDun_Level01 = 0x4D44
Global $A1_trDun_Level04 = 0x4D47
Global $A1_trDun_Level05_Templar = 0x15763
Global $A1_trDun_Level06 = 0x4D49
Global $A1_trDun_Level07B = 0x4D4B
Global $A1_trDun_Level07D = 0x4D4D
Global $A1_trDun_Tyrael_Level09 = 0x1CAA3
Global $A1_trDun_TyraelJail = 0x24447
Global $A1_trOut_AdriasCellar = 0xF5F8
Global $A1_trOUT_AdriasHut = 0x4DD9
Global $A1_trOut_BatesFarmCellar = 0x248A5
Global $A1_trOUT_Church = 0x4DDD
Global $A1_trOut_Fields_Vendor_Curios = 0x1A3B7
Global $A1_trOut_Fields_Vendor_Curios_Exterior = 0x2BE7B
Global $A1_trOUT_FishingVillage = 0x4DDF
Global $A1_trOUT_FishingVillageHeights = 0x1FB03
Global $A1_trOut_ForlornFarm = 0x20B72
Global $A1_trOUT_Graveyard = 0x4DE2
Global $A1_trOUT_Highlands = 0x4DE4
Global $A1_trOUT_Highlands_Bridge = 0x16DC0
Global $A1_trOut_Highlands_DunExterior_A = 0x15718
Global $A1_trOUT_Highlands_ServantHouse_Cellar_Vendor = 0x29CD1
Global $A1_trOUT_Highlands_Sub240_GoatmanGraveyard = 0x1F95F
Global $A1_trOUT_Highlands2 = 0x4DE5
Global $A1_trOUT_Highlands3 = 0x4AF
Global $A1_trOut_Leoric_Manor_Int = 0x189F6
Global $A1_trOUT_LeoricsManor = 0x4DE7
Global $A1_trOut_MysticWagon = 0x20F08
Global $A1_trOUT_NewTristram = 0x4DEB
Global $A1_trOUT_NewTristram_AttackArea = 0x316CE
Global $A1_trOUT_NewTristramOverlook = 0x26186
Global $A1_trOut_Old_Tristram = 0x163FD
Global $A1_trOut_Old_Tristram_Road = 0x164BC
Global $A1_trOut_Old_Tristram_Road_Cath = 0x18BE7
Global $A1_trOut_OldTristram_Cellar = 0x1A22B
Global $A1_trOut_OldTristram_Cellar_1 = 0x1A104
Global $A1_trOut_OldTristram_Cellar_2 = 0x1A105
Global $A1_trOut_OldTristram_Cellar_3 = 0x19322
Global $A1_trOut_oldTristram_TreeCave = 0x19C87
Global $A1_trOut_Scoundrel_Event_Old_Mill_2 = 0x35556
Global $A1_trOut_TownAttack_ChapelCellar = 0x1D43E
Global $A1_trOut_Tristram_CainsHouse = 0x1FC73
Global $A1_trOut_Tristram_Inn = 0x1AB91
Global $A1_trOut_Tristram_LeahsRoom = 0x15349
Global $A1_trOut_TristramFields_A = 0x4DF0
Global $A1_trOut_TristramFields_B = 0x4DF1
Global $A1_trOut_TristramFields_ExitA = 0xF085
Global $A1_trOut_TristramFields_Forsaken_Grounds = 0x2BD6F
Global $A1_trOut_TristramFields_Secluded_Grove = 0x2BD6E
Global $A1_trOut_TristramWilderness = 0x4DF2
Global $A1_trOut_TristramWilderness_SubScenes = 0x236AA
Global $A1_trOut_Vendor_Tinker_Room = 0x19821
Global $A1_trOut_Wilderness_BurialGrounds = 0x11C08
Global $A1_trOut_Wilderness_CorpseHouse = 0x30ADF
Global $A1_trOut_Wilderness_Sub80_FamilyTree = 0x236A1
Global $A2_Belial_Room_01 = 0xED55
Global $A2_Belial_Room_Intro = 0x13D1A
Global $A2_c1Dun_Swr_Caldeum_01 = 0x4D4F
Global $A2_c2dun_Zolt_TreasureHunter = 0x4D53
Global $A2_c3Dun_Aqd_Oasis_Level01 = 0xE069
Global $A2_cadun_Zolt_Timed01_Level01 = 0x4D52
Global $A2_cadun_Zolt_Timed01_Level02 = 0x29108
Global $A2_Caldeum = 0x19234
Global $A2_Caldeum_Uprising = 0x33613
Global $A2_caOut_Alcarnus_RandomCellar_1 = 0x245A7
Global $A2_caOut_Alcarnus_RandomCellar_2 = 0x245A8
Global $A2_caOut_Alcarnus_RandomCellar_3 = 0x245A9
Global $A2_caOUT_Boneyard_01 = 0xD24A
Global $A2_caOUT_Borderlands_Khamsin_Mine = 0xEE8A
Global $A2_caOUT_BorderlandsKhamsin = 0xF8B2
Global $A2_caOut_Cellar_Alcarnus_Main = 0x2FAC4
Global $A2_caOut_CT_RefugeeCamp = 0xD811
Global $A2_caOut_CT_RefugeeCamp_Gates = 0x318FD
Global $A2_caOut_CT_RefugeeCamp_Hub = 0x2917A
Global $A2_caOut_Hub_Inn = 0x2AA00
Global $A2_caOut_Interior_C_DogBite = 0x2D7BB
Global $A2_caOut_Interior_H_RockWorm = 0x232F5
Global $A2_caOut_Mine_Abandoned_Cellar = 0x4D81
Global $A2_caOut_Oasis = 0xE051
Global $A2_caOut_Oasis_Exit = 0x2ACE2
Global $A2_caOut_Oasis_Exit_A = 0x2AD07
Global $A2_caOut_Oasis_Rakanishu = 0x33BDD
Global $A2_caOut_Oasis_RandomCellar_1 = 0x27099
Global $A2_caOut_Oasis_RandomCellar_2 = 0x2709A
Global $A2_caOut_Oasis_RandomCellar_3 = 0x2709B
Global $A2_caOut_Oasis_RandomCellar_4 = 0x27bE7
Global $A2_caOut_Oasis1_Water = 0xE664
Global $A2_caOut_Oasis2 = 0xE058
Global $A2_caOut_OasisCellars = 0x1B100
Global $A2_caOUT_StingingWinds = 0x4D7F
Global $A2_caOUT_StingingWinds_Alcarnus_Tier1 = 0x4D71
Global $A2_caOUT_StingingWinds_Alcarnus_Tier2 = 0x4D72
Global $A2_caOUT_StingingWinds_Bridge = 0x29886
Global $A2_caOUT_StingingWinds_Canyon = 0x4D7C
Global $A2_caOUT_StingingWinds_FallenCamp01 = 0x288EF
Global $A2_caOUT_StingingWinds_PostBridge = 0x4D7E
Global $A2_caOUT_StingingWinds_PreAlcarnus = 0x4D7B
Global $A2_caOUT_StingingWinds_PreBridge = 0x4D7D
Global $A2_caOut_Stranded2 = 0x1DA4A
Global $A2_caOut_ZakarwaMerchantCellar = 0x1BEBB
Global $A2_Cave_Random01 = 0x26F64
Global $A2_Cave_Random01_Level02 = 0x35E85
Global $A2_CultistCellarEast = 0x19218
Global $A2_CultistCellarWest = 0x19214
Global $A2_dun_Aqd_Control_A = 0xF9F3
Global $A2_dun_Aqd_Control_B = 0xF9F4
Global $A2_dun_Aqd_Oasis_RandomFacePuzzle_Large = 0x26B82
Global $A2_dun_Aqd_Oasis_RandomFacePuzzle_Small = 0x26AB0
Global $A2_dun_Aqd_Special_01 = 0xF520
Global $A2_dun_Aqd_Special_A = 0xF53A
Global $A2_dun_Aqd_Special_B = 0xF53C
Global $A2_Dun_Aqd_Swr_to_Oasis_Level01 = 0x23D96
Global $A2_dun_Cave_BloodVial_01 = 0x31F55
Global $A2_dun_Cave_BloodVial_02 = 0x31F83
Global $A2_dun_Oasis_Cave_MapDungeon = 0x29616
Global $A2_dun_Oasis_Cave_MapDungeon_Level02 = 0x2F6bF
Global $A2_dun_PortalRoulette_A = 0x1B37F
Global $A2_Dun_Swr_Adria_Level01 = 0xE47E
Global $A2_Dun_Swr_Caldeum_Sewers_01 = 0x1B205
Global $A2_dun_Zolt_Blood02_Level01_Part1 = 0x1E12E
Global $A2_dun_Zolt_Blood02_Level01_Part2 = 0x25872
Global $A2_Dun_Zolt_BossFight_Level04 = 0xEB22
Global $A2_dun_Zolt_Head_Random01 = 0xF0C0
Global $A2_Dun_Zolt_Level01 = 0x4D55
Global $A2_Dun_Zolt_Level02 = 0x4D56
Global $A2_Dun_Zolt_Level03 = 0x4D57
Global $A2_Dun_Zolt_Lobby = 0x4D58
Global $A2_Dun_Zolt_LobbyCenter = 0x2AFBA
Global $A2_Dun_Zolt_Random_Level01 = 0x4D59
Global $A2_Dun_Zolt_Random_Level02 = 0x36571
Global $A2_dun_Zolt_Random_PortalRoulette_02 = 0x2FDCF
Global $A2_Dun_Zolt_ShadowRealm_Level01 = 0x13AD0
Global $A2_Event_DyingManMine = 0x2270B
Global $A2_Event_PriceOfMercy_Cellar = 0x2FD9E
Global $A2_Rockworm_Cellar_Cave = 0x2FE81
Global $A2_trDun_Boneyard_Spider_Cave_01 = 0x1B437
Global $A2_trDun_Boneyard_Spider_Cave_02 = 0x35758
Global $A2_trDun_Boneyard_Worm_Cave_01 = 0x1B433
Global $A2_trDun_Boneyard_Worm_Cave_02 = 0x35759
Global $A2_trDun_Cave_Oasis_Random01 = 0xF46F
Global $A2_trDun_Cave_Oasis_Random01_Level02 = 0x2F6C2
Global $A2_trDun_Cave_Oasis_Random02 = 0xF46E
Global $A2_trDun_Cave_Oasis_Random02_Level02 = 0x27551
Global $A2_dun_Aqd_Oasis_Level00 = 0x2F0B6
Global $A2_dun_Aqd_Oasis_Level01 = 0x2F0B1
Global $A3_AzmodanFight = 0x1B39C
Global $A3_Battlefield_A = 0x1B7A4
Global $A3_Battlefield_B = 0x1B7B5
Global $A3_Battlefield_C = 0x1B7C4
Global $A3_Bridge_01 = 0x10F80
Global $A3_Bridge_Choke_A = 0x25DA8
Global $A3_Dun_Battlefield_Gate = 0x25C14
Global $A3_dun_Bridge_Interior_Random01 = 0x224ad
Global $A3_dun_Bridge_Interior_Random02 = 0x32270
Global $A3_Dun_Crater_Level_01 = 0x15040
Global $A3_Dun_Crater_Level_02 = 0x1d209
Global $A3_Dun_Crater_Level_03 = 0x1d20a
Global $A3_dun_Crater_ST_Level01 = 0x13b97
Global $A3_dun_Crater_ST_Level01B = 0x1d365
Global $A3_dun_Crater_ST_Level02 = 0x13b98
Global $A3_dun_Crater_ST_Level02B = 0x2200a
Global $A3_dun_Crater_ST_Level04 = 0x14cd2
Global $A3_dun_Crater_ST_Level04B = 0x1d368
Global $A3_dun_IceCaves_Random_01 = 0x2e3a1
Global $A3_dun_IceCaves_Random_01_Level_02 = 0x36206
Global $A3_dun_IceCaves_Timed_01 = 0x2ea66
Global $A3_dun_IceCaves_Timed_01_Level_02 = 0x36207
Global $A3_Dun_Keep_Hub = 0x16b11
Global $A3_Dun_Keep_Hub_Inn = 0x2d38c
Global $A3_Dun_Keep_Level03 = 0x126ac
Global $A3_Dun_Keep_Level04 = 0x16baf
Global $A3_Dun_Keep_Level05 = 0x21500
Global $A3_Dun_Keep_Random_01 = 0x2aa4a
Global $A3_Dun_Keep_Random_01_Level_02 = 0x36238
Global $A3_Dun_Keep_Random_02 = 0x2c7f2
Global $A3_Dun_Keep_Random_02_Level_02 = 0x36239
Global $A3_Dun_Keep_Random_03 = 0x2c802
Global $A3_Dun_Keep_Random_03_Level_02 = 0x3623a
Global $A3_Dun_Keep_Random_04 = 0x2c8e6
Global $A3_Dun_Keep_Random_04_Level_02 = 0x36241
Global $A3_Dun_Keep_Random_Cellar_01 = 0x35ee9
Global $A3_Dun_Keep_Random_Cellar_02 = 0x35ee8
Global $A3_Dun_Keep_Random_Cellar_03 = 0x303f7
Global $A3_Dun_Keep_TheBreach_Level04 = 0x3558f
Global $A3_dun_rmpt_Level01 = 0x16b20
Global $A3_dun_rmpt_Level02 = 0x16bf5
Global $A3_Gluttony_Boss = 0x1b280
Global $A3_dun_Hub_Adria_Tower = 0x31222
Global $A3_dun_hub_AdriaTower_Intro_01 = 0x3253e
Global $A4_dun_Diablo_Arena = 0x1abfb
Global $A4_dun_Diablo_Arena_Phase3 = 0x348c3
Global $A4_dun_Garden_of_Hope_01 = 0x1abca
Global $A4_dun_Garden_of_Hope_02 = 0x1abcc
Global $A4_dun_Garden3_SpireEntrance = 0x1d44a
Global $A4_dun_Heaven_1000_Monsters_Fight = 0x1aa5d
Global $A4_dun_Heaven_1000_Monsters_Fight_Entrance = 0x2f169
Global $A4_dun_Hell_Portal_01 = 0x1abd6
Global $A4_dun_Hell_Portal_02 = 0x1abdb
Global $A4_Dun_Keep_Hub = 0x301ed
Global $A4_dun_LibraryOfFate = 0x23120
Global $A4_dun_Spire_00 = 0x307a4
Global $A4_dun_Spire_01 = 0x1abe2
Global $A4_dun_Spire_02 = 0x1abe4
Global $A4_dun_Spire_03 = 0x1abe6
Global $A4_dun_Spire_04 = 0x33728
Global $A4_dun_Spire_SigilRoom_A = 0x313c4
Global $A4_dun_Spire_SigilRoom_B = 0x2ae7a
Global $A4_dun_Spire_SigilRoom_C = 0x313c6
Global $A4_dun_Spire_SigilRoom_D = 0x313c7
Global $A4_dun_Diablo_ShadowRealm_01 = 0x25845
Global $A4_dun_spire_DiabloEntrance = 0x3227a
Global $A4_dun_spire_exterior = 0x34964
Global $Axe_Bad_Data = 0x4d60
Global $PvP_Maze_01 = 0x4da2
Global $PvP_Octogon_01 = 0x4da3
Global $PvP_Pillar_01 = 0x4da4
Global $PvP_Stairs_01 = 0x4da5
Global $PvP_Test_BlueTeam = 0x4da6
Global $PvP_Test_Neutral = 0x4da7
Global $PvP_Test_RedTeam = 0x4da8
Global $PvPArena = 0x4d9c
EndFunc ;==>LevelAreaConstants
;;--------------------------------------------------------------------------------
;; Find which Act we are in
;;--------------------------------------------------------------------------------
Func GetAct()
If $Act = 0 Then
$arealist = FileRead("lib\area.txt")
$area = GetLevelAreaId()
_log(" We are in map : " & $area)
Local $pattern = "([\w'-]{5,80})\t\W\t" & $area
$asResult = StringRegExp($arealist, $pattern, 1)
If @error == 0 Then
Global $MyArea = $asResult[0]
If StringInStr($MyArea, "a1") Then
$Act = 1
ElseIf StringInStr($MyArea, "a2") Then
$Act = 2
ElseIf StringInStr($MyArea, "a3") Then
$Act = 3
ElseIf StringInStr($MyArea, "a4") Then
$Act = 4
EndIf
; _log("We are in map : " & $area &" " & $asResult[0])
;set our vendor aaccording to the act we are in as we know it.
Switch $Act
Case 1
Global $RepairVendor = "UniqueVendor_miner_InTown"
Case 2
Global $RepairVendor = "UniqueVendor_Peddler_InTown" ; act 2 fillette
Case 3
Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
Case 4
Global $RepairVendor = "UniqueVendor_Collector_InTown" ; act 3
EndSwitch
_log("Our Current Act is : " & $Act & " ---> So our vendor is : " & $RepairVendor)
EndIf
EndIf
EndFunc ;==>GetAct
;;--------------------------------------------------------------------------------
;; Adapt repair tab aaccording to MP act and diff
;;--------------------------------------------------------------------------------
Func GetRepairTab()
GetMonsterPow()
GetDifficulty()
GetAct()
If $MP > 0 And $GameDifficulty = 4 Then
Switch $Act
Case 1
Global $RepairTab = 1
Case 2 To 4
Global $RepairTab = 2
EndSwitch
Else
Switch $Act
Case 1
Global $RepairTab = 2
Case 2 To 4
Global $RepairTab = 3
EndSwitch
EndIf
_log("RepairTab : " & $RepairTab & " ---> MP : " & $MP & " GameDiff : " & $GameDifficulty)
EndFunc ;==>GetRepairTab
;;--------------------------------------------------------------------------------
;; Find MP MF handicap
;; Get MF handicap and deduce game MP from it
;;
;;--------------------------------------------------------------------------------
Func GetMonsterPow()
$MfCap = (IterateActorAtribs($_MyGuid, $Atrib_Magic_Find_Handicap) * 10)
$MP = Round($MfCap, 0)
_log("Power monster : " & $MP)
EndFunc ;==>GetMonsterPow
;;--------------------------------------------------------------------------------
;; Find Difficulty from vendor
;; Get vendor Level and deduce game difficulty from it
;; $GameDifficulty = not yet determined, 1 = Norm, 2 = Nm, 3 = Hell, 4 = Inferno
;;--------------------------------------------------------------------------------
Func GetDifficulty()
If $GameDifficulty = 0 Then
Local $index, $offset, $count, $item[4]
startIterateLocalActor($index, $offset, $count)
While iterateLocalActorList($index, $offset, $count, $item)
If StringInStr($item[1], $RepairVendor) Then
Global $npclevel = IterateActorAtribs($item[0], $Atrib_Level)
Switch $npclevel
Case 1 To 59
Global $GameDifficulty = 1
Case 60 To 70
Global $GameDifficulty = 4
EndSwitch
ExitLoop
EndIf
WEnd
_log("Game Difficulty is : " & $GameDifficulty)
EndIf
EndFunc ;==>GetDifficulty
;;--------------------------------------------------------------------------------
; Function: TownStateCheck()
; Description: Check if we are in town or not by comparing distance from stash
;
;;--------------------------------------------------------------------------------
Func _intown()
If $_debug Then _log("-----Checking if In Town------")
$town = findActor('Player_Shared_Stash', 448)
If Not @error Then
_log("We are in town ")
Return True
Else
_log("We are NOT in town ")
Return False
EndIf
EndFunc ;==>_intown
;==>TownStateCheck
;;--------------------------------------------------------------------------------
;; Getting Backpack Item Info
;;--------------------------------------------------------------------------------
Func IterateBackpack($bag = 0, $rlvl = 0)
;$bag = 0 for backpack and 15 for stash
;$rlvl = 1 for actual level requirement of item and 0 for base required level
$ptr1 = _memoryread($ofs_objectmanager, $d3, "ptr")
$ptr2 = _memoryread($ptr1 + 0x868, $d3, "ptr")
$ptr3 = _memoryread($ptr2 + 0x0, $d3, "ptr")
$_Count = _memoryread($ptr3 + 0x108, $d3, "int")
$CurrentOffset = _memoryread(_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$_LocalActor_3
Local $__ACDACTOR[$_Count + 1][9]
For $i = 0 To $_Count
$__ACDACTOR[$i][0] = _MemoryRead($CurrentOffset, $d3, 'ptr')
$__ACDACTOR[$i][1] = _MemoryRead($CurrentOffset + 0x4, $d3, 'char[64]')
$__ACDACTOR[$i][2] = _MemoryRead($CurrentOffset + 0x114, $d3, 'int')
$__ACDACTOR[$i][3] = _MemoryRead($CurrentOffset + 0x118, $d3, 'int')
$__ACDACTOR[$i][4] = _MemoryRead($CurrentOffset + 0x11C, $d3, 'int')
$__ACDACTOR[$i][5] = 0
$__ACDACTOR[$i][6] = _MemoryRead($CurrentOffset + $ofs_LocalActor_atribGUID, $d3, 'ptr')
$__ACDACTOR[$i][7] = $CurrentOffset
$__ACDACTOR[$i][8] = _MemoryRead($CurrentOffset + 0xB4, $d3, 'int')
$CurrentOffset = $CurrentOffset + $ofs_LocalActor_StrucSize
Next
For $i = $_Count To 0 Step -1
If $__ACDACTOR[$i][2] <> $bag Then
_ArrayDelete($__ACDACTOR, $i)
Else
$__ACDACTOR[$i][5] = GetPackItemLevel($__ACDACTOR[$i][6], $Atrib_Requirement)
If $rlvl Then
$lvlReduce = GetPackItemLevel($__ACDACTOR[$i][6], $Atrib_Item_Level_Requirement_Reduction)
If $lvlReduce Then $__ACDACTOR[$i][5] = $__ACDACTOR[$i][5] - $lvlReduce
EndIf
EndIf
Next
Return $__ACDACTOR
EndFunc ;==>IterateBackpack
;;--------------------------------------------------------------------------------
; Function: GetPackItemLevel($ACD, $_REQ)
;;--------------------------------------------------------------------------------
Func GetPackItemLevel($ACD, $_REQ)
;IterateLocalActor()
;$ACDIndex = _ArraySearch($__ACTOR, "0x" & Hex($_guid), 0, 0, 0, 1, 1, 1) ;this bitch is slow as hell
If $ACD = -1 Then Return False
$_Count = _MemoryRead($_ActorAtrib_Count, $d3, 'int')
$CurrentOffset = $_ActorAtrib_4
Dim $ACTORatrib
For $i = 0 To $_Count
$ACTORatrib = _MemoryRead($CurrentOffset, $d3, 'ptr')
If $ACTORatrib = $ACD Then
$test = _MemoryRead($CurrentOffset + 0x10, $d3, 'ptr')
$CurretOffset = $test
For $i = 0 To 825
$data = _MemoryRead($CurretOffset, $d3, 'ptr')
$CurretOffset = $CurretOffset + 0x4
If $data <> 0x0 Then
$AtribData = _MemoryRead($data + 0x4, $d3, 'ptr')
If StringLeft($AtribData, 7) = "0x0003B" Then
;ConsoleWrite("Debug :" &$data+0x4 & " : " & _MemoryRead($data+0x4, $d3, 'int') &@crlf) ;FOR DEBUGGING
If "0x" & StringRight($AtribData, 3) = $_REQ[0] Then
Return _MemoryRead($data + 0x8, $d3, $_REQ[1])
EndIf
EndIf
If StringLeft($AtribData, 7) = "0xFFFFF" Then
;ConsoleWrite("Debug :" &$data+0x4 & " : " & _MemoryRead($data+0x4, $d3, 'int') &@crlf) ;FOR DEBUGGING
If "0x" & StringRight($AtribData, 3) = $_REQ[0] Then
Return _MemoryRead($data + 0x8, $d3, $_REQ[1])
EndIf
EndIf
EndIf
Next
Return False
EndIf
$CurrentOffset = $CurrentOffset + $ofs_ActorAtrib_StrucSize
Next
Return False
EndFunc ;==>GetPackItemLevel
;;--------------------------------------------------------------------------------
;; Getting Backpack Item Info, extended to show some more info
;; $bag = 0 for backpack and 15 for stash
;;--------------------------------------------------------------------------------
Func IterateBackpackExtendedWithLvl($bag = 0)
$list = IndexSNO($gameBalance)
$armorOffs = 0
$weaponOffs = 0
$otherOffs = 0
For $j = 0 To UBound($list) - 1
;19750 = armor, 19754 = weapon, 1953 = other
If ($list[$j][1] = 19750) Then
$armorOffs = $list[$j][0]
EndIf
If ($list[$j][1] = 19754) Then
$weaponOffs = $list[$j][0]
EndIf
If ($list[$j][1] = 19753) Then
$otherOffs = $list[$j][0]
EndIf
Next
Local $armorItems = GetLevels($armorOffs)
Local $weaponItems = GetLevels($weaponOffs)
Local $otherItems = GetLevels($otherOffs)
Local $data = IterateBackpack($bag)
Local $armorItemsWithLvl = MapItemWithLvl($data, $armorItems, 8)
Local $weaponItemsWithLvl = MapItemWithLvl($data, $weaponItems, 8)
Local $otherItemsWithLvl = MapItemWithLvl($data, $otherItems, 8)
Local $allItems[UBound($armorItemsWithLvl, 1)][UBound($armorItemsWithLvl, 2)]
For $i = 0 To UBound($allItems) - 1 Step 1
If $armorItemsWithLvl[$i][9] <> "" Then
;copy from $armorItemsWithLvl to all items
For $j = 0 To UBound($armorItemsWithLvl, 2) - 1 Step 1
$allItems[$i][$j] = $armorItemsWithLvl[$i][$j]
Next
ElseIf $weaponItemsWithLvl[$i][9] <> "" Then
;copy from $weaponItemsWithLvl to all items
For $j = 0 To UBound($weaponItemsWithLvl, 2) - 1 Step 1
$allItems[$i][$j] = $weaponItemsWithLvl[$i][$j]
Next
ElseIf $otherItemsWithLvl[$i][9] <> "" Then
;copy from $otherItemsWithLvl to all items
For $j = 0 To UBound($otherItemsWithLvl, 2) - 1 Step 1
$allItems[$i][$j] = $otherItemsWithLvl[$i][$j]
Next
EndIf
Next
Return $allItems
EndFunc ;==>IterateBackpackExtendedWithLvl
;;--------------------------------------------------------------------------------
;; Maps snos containg a lvl to the item with that snoid
;;--------------------------------------------------------------------------------
Func MapItemWithLvl($items, $snowithlvl, $indexForBGID)
Local $newItems = $items
ReDim $newItems[UBound($items, 1)][UBound($items, 2) + UBound($snowithlvl, 2) + 9] ;add size for some new variables
For $i = 0 To UBound($items) - 1 Step 1
For $j = 0 To UBound($snowithlvl) - 1 Step 1
If $snowithlvl[$j][0] = $items[$i][$indexForBGID] Then
$newItems[$i][$indexForBGID + 1] = $snowithlvl[$j][1] ;ilvl
$newItems[$i][$indexForBGID + 2] = $snowithlvl[$j][2] ;min dmg
$newItems[$i][$indexForBGID + 3] = $snowithlvl[$j][3] ;;max dmg
$newItems[$i][$indexForBGID + 4] = $snowithlvl[$j][4] ;;min armor
$newItems[$i][$indexForBGID + 5] = $snowithlvl[$j][5] ;max armor
$newItems[$i][$indexForBGID + 6] = $snowithlvl[$j][6] ;min dmg modifier
$newItems[$i][$indexForBGID + 7] = $snowithlvl[$j][7] ;max dmg modifier
$newItems[$i][$indexForBGID + 8] = $snowithlvl[$j][8] ;gold
$newItems[$i][$indexForBGID + 9] = $snowithlvl[$j][9] ;weapon speed
;;some extra attributes
$newItems[$i][$indexForBGID + 10] = IterateActorAtribs($newItems[$i][0], $Atrib_Item_Quality_Level) ;quality lvl
$newItems[$i][$indexForBGID + 11] = IterateActorAtribs($newItems[$i][0], $Atrib_Strength_Item) ;str
$newItems[$i][$indexForBGID + 12] = IterateActorAtribs($newItems[$i][0], $Atrib_Vitality_Item) ;vit
$newItems[$i][$indexForBGID + 12] = IterateActorAtribs($newItems[$i][0], $Atrib_Intelligence_Item) ;int
$newItems[$i][$indexForBGID + 13] = IterateActorAtribs($newItems[$i][0], $Atrib_Dexterity_Item) ;dex
$newItems[$i][$indexForBGID + 15] = IterateActorAtribs($newItems[$i][0], $Atrib_Resistance_All) ;all res
$newItems[$i][$indexForBGID + 16] = Round(IterateActorAtribs($newItems[$i][0], $Atrib_Gold_Find) * 100) ;gf in %
$newItems[$i][$indexForBGID + 17] = Round(IterateActorAtribs($newItems[$i][0], $Atrib_Magic_Find) * 100) ;mf in %
$newItems[$i][$indexForBGID + 18] = Round(IterateActorAtribs($newItems[$i][0], $Atrib_Hitpoints_Max_Percent_Bonus_Item) * 100) ;life %
$newItems[$i][$indexForBGID + 19] = _MemoryRead($newItems[$i][7] + 0x164, $d3, 'int') > 0 ;0ffset + 164 ;true=unid, false=identified
ExitLoop
EndIf
Next
Next
Return $newItems
EndFunc ;==>MapItemWithLvl
;;--------------------------------------------------------------------------------
;; Gets levels from Gamebalance file, returns a list with snoid and lvl
;;--------------------------------------------------------------------------------
Func GetLevels($offset)
If $offset <> 0 Then
$ofs = $offset + 0x218;
$read = _MemoryRead($ofs, $d3, 'int')
While $read = 0
$ofs += 0x4
$read = _MemoryRead($ofs, $d3, 'int')
WEnd
$size = _MemoryRead($ofs + 0x4, $d3, 'int')
$size -= 0x5F0
$ofs = $offset + _MemoryRead($ofs, $d3, 'int')
$nr = $size / 0x5F0
Local $snoItems[$nr + 1][10]
$j = 0
For $i = 0 To $size Step 0x5F0
$ofs_address = $ofs + $i
$snoItems[$j][0] = _MemoryRead($ofs_address, $d3, 'ptr')
$snoItems[$j][1] = _MemoryRead($ofs_address + 0x114, $d3, 'int') ;lvl
$snoItems[$j][2] = _MemoryRead($ofs_address + 0x1C8, $d3, 'float') ;min dmg
$snoItems[$j][3] = $snoItems[$j][2] + _MemoryRead($ofs_address + 0x1CC, $d3, 'float') ;max dmg
$snoItems[$j][4] = _MemoryRead($ofs_address + 0x224, $d3, 'float') ;min armor
$snoItems[$j][5] = $snoItems[$j][4] + _MemoryRead($ofs_address + 0x228, $d3, 'float') ;max armor
$snoItems[$j][6] = _MemoryRead($ofs_address + 0x32C, $d3, 'float') ;min dmg modifier
$snoItems[$j][7] = $snoItems[$j][4] + _MemoryRead($ofs_address + 0x330, $d3, 'float') ;max dmg modifier
$snoItems[$j][8] = _MemoryRead($ofs_address + 0x12C, $d3, 'int') ;gold price
$snoItems[$j][9] = _MemoryRead($ofs_address + 0x2D4, $d3, 'float') ;wpn speed
$j += 1
Next
EndIf
Return $snoItems
EndFunc ;==>GetLevels
Func FilterBackpack()
Local $__ACDACTOR = IterateBackpack(0)
Local $iMax = UBound($__ACDACTOR)
If $iMax > 0 Then
Local $return[$iMax][3]
For $i = 0 To $iMax - 1
; Loop each item in the backpack
If _MemoryRead($__ACDACTOR[$i][7] + 0x164, $d3, 'int') > 0 Then
; this item is unid, lets identify it
Send("{SPACE}") ; make sure we close everything
Send("i") ; open the inventory
Sleep(150)
InventoryMove($__ACDACTOR[$i][3], $__ACDACTOR[$i][4])
If IterateActorAtribs($__ACDACTOR[$i][0], $Atrib_Item_Quality_Level) > 8 Then
Sleep(Random(500, 800))
MouseClick("Right")
Sleep(Random(4000, 4500))
Else
Sleep(Random(500, 800))
MouseClick("Right")
Sleep(Random(1000, 1500))
EndIf
Send("{SPACE}") ; make sure we close everything
EndIf
$itemDestination = CheckItem($__ACDACTOR[$i][0], $__ACDACTOR[$i][1])
$return[$i][0] = $__ACDACTOR[$i][3] ;col
$return[$i][1] = $__ACDACTOR[$i][4] ;row
$return[$i][2] = $itemDestination ;row
Next
Return $return
EndIf
Return False
; After using this function, you can loop the return array and make inventorymove
; InventoryMove($return[$i][0], $return[$i][1])
EndFunc ;==>FilterBackpack
;;================================================================================
; Function: CheckItem
; Description: This will check a single item and tell if we keep it or not
; This function will be the core of the item filtering
;
; Return: Trash
; Stash
; Salvage
; Inventory
;==================================================================================
Func CheckItem($_GUID, $_NAME)
; _log("guid: "&$_GUID &" name: "& $_NAME & " qual: "&IterateActorAtribs($_GUID, $Atrib_Item_Quality_Level))
If checkFromList($Potions, $_NAME) Then
_log($_NAME & " ==> It's a pot")
Return "Inventory"
ElseIf checkFromList($grabList, $_NAME) Then
_log($_NAME & " ==> It's in the grablist")
Return "Stash"
ElseIf (IterateActorAtribs($_GUID, $Atrib_Item_Quality_Level) >= $QualityLevel) Then ; filter the magic and higher
_log($_NAME & " ==> It's the quality level >" & $QualityLevel)
Return "Stash"
ElseIf (IterateActorAtribs($_GUID, $Atrib_Item_Quality_Level) >= 6) And checkFromList($rareList, $_NAME) Then ; filter the magic and higher
_log($_NAME & " ==> It's a rare in our list ")
Return "Stash"
EndIf
Return "Trash"
EndFunc ;==>CheckItem
Func InventoryMove($col = 0, $row = 0)
$Coords = UiRatio(530 + ($col * 27), 338 + ($row * 27))
MouseMove($Coords[0], $Coords[1], 5)
EndFunc ;==>InventoryMove
;;--------------------------------------------------------------------------------
;; Stop()
;;--------------------------------------------------------------------------------
Func Stop()
Exit
EndFunc ;==>Stop
;;================================================================================
; Function: LocateMyToon
; Note(s): This function is used by the OffsetList to
; get the current player data.
;==================================================================================
Func LocateMyToon()
If _ingame() Then
sleep(1000)
If $_debug Then _log("Looking for local player")
$_CurOffset = 0
$_CurOffset = $_itrObjectManagerD
$_Count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
For $i = 0 To $_Count Step +1
$_GUID = _MemoryRead($_CurOffset + 0x4, $d3, 'ptr')
$_SNO = _MemoryRead($_CurOffset + 0x88, $d3, 'ptr')
$_NAME = _MemoryRead($_CurOffset + 0x8, $d3, 'char[64]')
;ConsoleWrite("Value : " & $_NAME & @CRLF)
;_log($_NAME)
If $_SNO = 0x126D Or $_SNO = 0x126D Or $_SNO = 0x1271 Or $_SNO = 0x1990 Or $_SNO = 0x197E Or $_SNO = 0xCE5 Or $_SNO = 0xCD5 Or $_SNO = 0x123D2 Or $_SNO = 0x125C7 Or $_SNO = 0x1951 Or $_SNO = 0x1955 Then
Global $_Myoffset = $_CurOffset
If $_debug Then _log("My toon located at: " & $_Myoffset & ", GUID: " & $_GUID & ", SNO: " & $_SNO &", NAME: " & $_NAME & @CRLF)
;If $_GUID = 0xFFFFFFFF Then
; _log("offsetlist failed")
; Return False
;EndIf
Global $_MyGuid = $_GUID
setChararacter($_NAME)
Return True
ExitLoop
EndIf
$_CurOffset = $_CurOffset + $_ObjmanagerStrucSize
Next
Return False
Endif
EndFunc ;==>LocateMyToon
;;================================================================================
; Function: IterateLocalActor
; Note(s): Iterates through all the local actors.
; Used by IterateActorAtribs
; This is bad use of variables, should be fixed!
;==================================================================================
Func IterateLocalActor()
$ptr1 = _memoryread($ofs_objectmanager, $d3, "ptr")
$ptr2 = _memoryread($ptr1 + 0x868, $d3, "ptr")
$ptr3 = _memoryread($ptr2 + 0x0, $d3, "ptr")
$_Count = _memoryread($ptr3 + 0x108, $d3, "int")
$CurrentOffset = _memoryread(_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr");$_LocalActor_3
Global $__ACTOR[$_Count + 1][4]
For $i = 0 To $_Count
$__ACTOR[$i][1] = _MemoryRead($CurrentOffset, $d3, 'ptr')
$__ACTOR[$i][2] = _MemoryRead($CurrentOffset + 0x4, $d3, 'char[64]')
$__ACTOR[$i][3] = _MemoryRead($CurrentOffset + $ofs_LocalActor_atribGUID, $d3, 'ptr')
;_log($__ACTOR[$i][1] & " : " & $__ACTOR[$i][2] & " : " & $__ACTOR[$i][3])
$CurrentOffset = $CurrentOffset + $ofs_LocalActor_StrucSize
Next
EndFunc ;==>IterateLocalActor
Func startIterateLocalActor(ByRef $index, ByRef $offset, ByRef $count)
$ptr1 = _memoryread($ofs_objectmanager, $d3, "ptr")
$ptr2 = _memoryread($ptr1 + 0x868, $d3, "ptr")
$ptr3 = _memoryread($ptr2 + 0x0, $d3, "ptr")
$count = _memoryread($ptr3 + 0x108, $d3, "int")
$index = 0
$offset = _memoryread(_memoryread($ptr3 + 0x148, $d3, "ptr") + 0x0, $d3, "ptr")
EndFunc ;==>startIterateLocalActor
Func iterateLocalActorList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)
While 1
If $index > $count Then Return False
$index += 1
$item[0] = _MemoryRead($offset, $d3, 'ptr') ; $_ACTOR_ATRIB_GUID
$item[1] = _MemoryRead($offset + 0x4, $d3, 'char[64]') ; $_ACTOR_ATRIB_DATA
$item[2] = _MemoryRead($offset + $ofs_LocalActor_atribGUID, $d3, 'ptr') ; $_ACTOR_ATRIB
$item[3] = $offset ; Item Offset
$offset = $offset + $ofs_LocalActor_StrucSize
Return True
WEnd
EndFunc ;==>iterateLocalActorList
;;================================================================================
; Function: IterateActorAtribs($_GUID,$_REQ)
; Description: Read the requested attribute data from a actor defined by GUID
; Parameter(s): $_GUID - The GUID of the object you want the data from
; $_REQ - The data you want to request (the variable)
;
; Note(s): You can find a list of all the $_REQ variables in the Constants() function
; It should be noted that i have not checked them all through
; so the type ("float" or "int") might be wrong.
; This function will always return "false" if the requested atribute does not exsist
;==================================================================================
Func IterateActorAtribs($_GUID, $_REQ)
Local $index, $offset, $count, $item[4]
startIterateLocalActor($index, $offset, $count)
While iterateLocalActorList($index, $offset, $count, $item)
If $item[0] = "0x" & Hex($_GUID) Then
If $_REQ[1] = 'float' Then
Return $AttribInterop.GetAttributeFloat($item[2], $_REQ[0])
Else
Return $AttribInterop.GetAttributeInt($item[2], $_REQ[0])
EndIf
ExitLoop
EndIf
WEnd
Return False
;~ IterateLocalActor()
;~ $ACDIndex = _ArraySearch($__ACTOR, "0x" & Hex($_GUID), 0, 0, 0, 1, 1, 1) ;this bitch is slow as hell
;~ If $ACDIndex = -1 Then Return False ;FIX
;~ If $_REQ[1] = 'float' Then
;~ Return $AttribInterop.GetAttributeFloat($__ACTOR[$ACDIndex][3], $_REQ[0])
;~ Else
;~ Return $AttribInterop.GetAttributeInt($__ACTOR[$ACDIndex][3], $_REQ[0])
;~ EndIf
;~ Return False
EndFunc ;==>IterateActorAtribs
;;================================================================================
; Function: LinkActors
; Description: Read and index data from the specified offset
; Parameter(s): $_offset - The offset linking to the file def
; be in hex format (0x00000000).
; $_displayInfo - Setting this to 1 will make the function spit
; out the results while running
; Note(s): This function is used to index data from the MPQ files that
; that have been loaded into memory.
; Im not sure why the count doesnt go beyond 256.
; So for the time being if the count goes beyond 256 the size
; is set to a specified count and then the array will be scaled
; after when data will stop being available.
;==================================================================================
Func LinkActors($OBject, $_displayInfo = 0)
Global $OBject_Mem_Actor = $OBject
Global $Object_File_Actor = IndexSNO($ofs_ActorDef, 0)
Global $Object_File_Monster = IndexSNO($ofs_MonsterDef, 0)
Dim $__outputdata[UBound($OBject_Mem_Actor, 1) - 1][2]
For $i = 0 To UBound($OBject_Mem_Actor, 1) - 1
If $OBject_Mem_Actor[$i][9] <> -1 Then
$ItemIndex = _ArraySearch($Object_File_Actor, $OBject_Mem_Actor[$i][9], 0, 0, 0, 1, 1, 1)
If $ItemIndex > 0 Then
$MonsterID = _MemoryRead($Object_File_Actor[$ItemIndex][0] + 0x6c, $d3, 'ptr')
$ItemIndex = _ArraySearch($Object_File_Monster, $MonsterID, 0, 0, 0, 1, 1, 1)
If $ItemIndex > 0 Then
$Type = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_MonsterType, $d3, 'int')
$MonsterType = $_Const_MonsterType[$Type + 1]
$Race = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_MonsterRace, $d3, 'int')
$MonsterRace = $_Const_MonsterRace[$Race + 1]
$LevelNormal = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_LevelNormal, $d3, 'int') ;//Here are some data you can use if you want,
$LevelNightmare = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_LevelNightmare, $d3, 'int') ;//...it gives info about levels based on dificulty
$LevelHell = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_LevelHell, $d3, 'int')
$LevelInferno = _MemoryRead($Object_File_Monster[$ItemIndex][0] + $_ofs_FileMonster_LevelInferno, $d3, 'int')
$OBject_Mem_Actor[$i][11] = $Type
$OBject_Mem_Actor[$i][12] = $Race
;if $_displayInfo = 1 Then ConsoleWrite($i & " " & $Object_File_Actor[$ItemIndex][0] & @tab & " " &$MonsterType &@tab & " " & $MonsterRace &@tab & " Level Normal:" & $LevelNormal &@tab & " " & $StringListDB[$Name][1] &" " & @TAB &$OBject_Mem_Actor[$i][2] &@crlf)
EndIf
EndIf
EndIf
Next
Return $OBject_Mem_Actor
EndFunc ;==>LinkActors
;;================================================================================
; Function: IndexSNO($_offset[,$_displayInfo = 0])
; Description: Read and index data from the specified offset
; Parameter(s): $_offset - The offset linking to the file def
; be in hex format (0x00000000).
; $_displayInfo - Setting this to 1 will make the function spit
; out the results while running
; Note(s): This function is used to index data from the MPQ files that
; that have been loaded into memory.
; Im not sure why the count doesnt go beyond 256.
; So for the time being if the count goes beyond 256 the size
; is set to a specified count and then the array will be scaled
; after when data will stop being available.
;==================================================================================
Func IndexSNO($_offset, $_displayInfo = 0)
Local $CurrentSnoOffset = 0x0
$_MainOffset = _MemoryRead($_offset, $d3, 'ptr')
$_Pointer = _MemoryRead($_MainOffset + $_defptr, $d3, 'ptr')
$_SnoCount = _MemoryRead($_Pointer + $_defcount, $d3, 'ptr') ;//Doesnt seem to go beyond 256 for some wierd reason
If $_SnoCount >= 256 Then ;//So incase it goes beyond...
$ignoreSNOcount = 1 ;//This enables a redim after the for loop
$_SnoCount = 4056 ;//We put a limit to avoid overflow here
Else
$ignoreSNOcount = 0
EndIf
$_SnoIndex = _MemoryRead($_Pointer + $_deflink, $d3, 'ptr') ;//Moving from the static into the index
$_SNOName = _MemoryRead($_Pointer, $d3, 'char[64]') ;//Usually something like "Something" + Def
$TempWindex = $_SnoIndex + 0xC ;//The header is 0xC in size
If $_displayInfo = 1 Then ConsoleWrite("-----* Indexing " & $_SNOName & " *-----" & @CRLF)
Dim $_OutPut[$_SnoCount + 1][2] ;//Setting the size of the output array
For $i = 1 To $_SnoCount Step +1 ;//Iterating through all the elements
$_CurSnoOffset = _MemoryRead($TempWindex, $d3, 'ptr') ;//Getting the offset for the item
$_CurSnoID = _MemoryRead($_CurSnoOffset, $d3, 'ptr') ;//Going into the item and grapping the GUID which is located at 0x0
If $ignoreSNOcount = 1 And $_CurSnoOffset = 0x00000000 And $_CurSnoID = 0x00000000 Then ExitLoop ;//Untill i find a way to get the real count we do this instead.
If $ignoreSNOcount = 1 Then $CurIndex = $i
$_OutPut[$i][0] = $_CurSnoOffset ;//Poping the data into the output array
$_OutPut[$i][1] = $_CurSnoID
If $_displayInfo = 1 Then ConsoleWrite($i & " Offset: " & $_CurSnoOffset & " SNOid: " & $_CurSnoID & @CRLF)
$TempWindex = $TempWindex + 0x10 ;//Next item is located 0x10 later
Next
If $ignoreSNOcount = 1 Then ReDim $_OutPut[$CurIndex][2] ;//Here we do the resizing of the array, to minimize memory footprint!?.
Return $_OutPut
EndFunc ;==>IndexSNO
;;================================================================================
; Function: IndexStringList($_offset)
; Description: Read and index data from the specified offset
; Parameter(s): $_offset - The offset linking to the file def
; be in hex format (0x00000000).
; $_displayInfo - Setting this to 1 will make the function spit
; out the results while running
;
; Note(s): This function is made specificly to index string lists.
; This is usefull for getting real localized names from the
; proxy names you get from the objectmanager strucs.
; i have only test this on monster names but it should work for all.
;==================================================================================
Func IndexStringList($_offset, $_displayInfo = 0)
$_offset_FileMonster_StrucSize = 0x50
$_StringCount = _MemoryRead($_offset + 0xc, $d3, 'int')
$_CurrentOffset = $_offset + 0x28
Dim $_OutPut[$_StringCount][2]
For $i = 0 To $_StringCount - 1
$_OutPut[$i][0] = _MemoryRead(_MemoryRead($_CurrentOffset, $d3, 'int'), $d3, 'char[32]') ;Proxy Name, like "Priest_Male_B_NoLook"
$_OutPut[$i][1] = _MemoryRead(_MemoryRead($_CurrentOffset + 0x10, $d3, 'int'), $d3, 'char[34]') ;Localized name, like "Brother Malachi the Healer"
Assign("__" & $_OutPut[$i][0], $_OutPut[$i][1], 2)
$_CurrentOffset = $_CurrentOffset + $_offset_FileMonster_StrucSize
If $_displayInfo = 1 Then ConsoleWrite($_CurrentOffset & " ProxyName: " & $_OutPut[$i][0] & @TAB & " LocalizedName: " & $_OutPut[$i][1] & @CRLF)
Next
Return $_OutPut
EndFunc ;==>IndexStringList
;;--------------------------------------------------------------------------------
;; OffsetList()
;;--------------------------------------------------------------------------------
Func offsetlist()
_log("offsetlist")
;//FILE DEFS
Global $ofs_MonsterDef = 0x15DBE00 ;0x015DCE00 ;0x15DBE00
Global $ofs_StringListDef = 0x0158C240 ;0x015E8808 ;0x015E9808
Global $ofs_ActorDef = 0x15EC108 ;0x015ED108 ;0x15EC108
Global $_defptr = 0x10
Global $_defcount = 0x10C
Global $_deflink = 0x148
Global $_ofs_FileMonster_StrucSize = 0x50
Global $_ofs_FileActor_LinkToMonster = 0x6C
Global $_ofs_FileMonster_MonsterType = 0x18
Global $_ofs_FileMonster_MonsterRace = 0x1C
Global $_ofs_FileMonster_LevelNormal = 0x44
Global $_ofs_FileMonster_LevelNightmare = 0x48
Global $_ofs_FileMonster_LevelHell = 0x4c
Global $_ofs_FileMonster_LevelInferno = 0x50
;//GET ACTORATRIB
Global $ofs_ActorAtrib_Base = 0x1544E54 ;0x15A1EA4 ;0x015A2EA4;0x015A1EA4
Global $ofs_ActorAtrib_ofs1 = 0x390
Global $ofs_ActorAtrib_ofs2 = 0x2E8
Global $ofs_ActorAtrib_ofs3 = 0x148
Global $ofs_ActorAtrib_Count = 0x108 ; 0x0 0x0
Global $ofs_ActorAtrib_Indexing_ofs1 = 0x10
Global $ofs_ActorAtrib_Indexing_ofs2 = 0x8
Global $ofs_ActorAtrib_Indexing_ofs3 = 0x250
Global $ofs_ActorAtrib_StrucSize = 0x180
Global $ofs_LocalPlayer_HPBARB = 0x34
Global $ofs_LocalPlayer_HPWIZ = 0x38
;//GET LOCAL ACTOR STRUC
Global $ofs_LocalActor_ofs1 = 0x378 ;instead of $ofs_ActorAtrib_ofs2
Global $ofs_LocalActor_ofs2 = 0x148
Global $ofs_LocalActor_Count = 0x108
Global $ofs_LocalActor_atribGUID = 0x120
Global $ofs_LocalActor_StrucSize = 0x2D0 ; 0x0 0x0
;//OBJECT MANAGER
Global $ofs_objectmanager = 0x1873414 ;0x0186FA3C ;0x1543B9C ;0x15A0BEC ;0x015A1BEC;0x15A0BEC
Global $ofs__ObjmanagerActorOffsetA = 0x8C8 ;0x8b0
Global $ofs__ObjmanagerActorCount = 0x108
Global $ofs__ObjmanagerActorOffsetB = 0x148
Global $ofs__ObjmanagerActorLinkToCTM = 0x384
Global $_ObjmanagerStrucSize = 0x42C ;0x428
;//CameraDef
Global $VIewStatic = 0x015A0BEC
Global $DebugFlags = $VIewStatic + 0x20
Global $vftableSubA = _MemoryRead($VIewStatic, $d3, 'ptr')
Global $vftableSubA = _MemoryRead($vftableSubA + 0x928, $d3, 'ptr')
Global $ViewOffset = $vftableSubA
Global $Ofs_CameraRotationA = $ViewOffset + 0x4
Global $Ofs_CameraRotationB = $ViewOffset + 0x8
Global $Ofs_CameraRotationC = $ViewOffset + 0xC
Global $Ofs_CameraRotationD = $ViewOffset + 0x10
Global $Ofs_CameraPosX = $ViewOffset + 0x14
Global $Ofs_CameraPosY = $ViewOffset + 0x18
Global $Ofs_CameraPosZ = $ViewOffset + 0x1C
Global $Ofs_CameraFOV = $ViewOffset + 0x30
Global $Ofs_CameraFOVB = $ViewOffset + 0x30
Global $ofs_InteractBase = 0x1543B84 ;0x15A0BD4 ;0x015A1BD4;0x15A0BD4
Global $ofs__InteractOffsetA = 0xA8
Global $ofs__InteractOffsetB = 0x58
Global $ofs__InteractOffsetUNK1 = 0x7F20 ;Set to 777c
Global $ofs__InteractOffsetUNK2 = 0x7F44 ;Set to 1 for NPC interaction
Global $ofs__InteractOffsetUNK3 = 0x7F7C ;Set to 7546 for NPC interaction, 7545 for loot interaction
Global $ofs__InteractOffsetUNK4 = 0x7F80 ;Set to 7546 for NPC interaction, 7545 for loot interaction
Global $ofs__InteractOffsetMousestate = 0x7F84 ;Mouse state 1 = clicked, 2 = mouse down
Global $ofs__InteractOffsetGUID = 0x7F88 ;Set to the GUID of the actor you want to interact with
$FixSpeed = 0x20 ;69736
$ToggleMove = 0x34
$MoveToXoffset = 0x40
$MoveToYoffset = 0x44
$MoveToZoffset = 0x48
$CurrentX = 0xA8
$CurrentY = 0xAc
$CurrentZ = 0xb0
$RotationOffset = 0x174
Global $_ActorAtrib_Base = _MemoryRead($ofs_ActorAtrib_Base, $d3, 'ptr')
Global $_ActorAtrib_1 = _MemoryRead($_ActorAtrib_Base + $ofs_ActorAtrib_ofs1, $d3, 'ptr')
Global $_ActorAtrib_2 = _MemoryRead($_ActorAtrib_1 + $ofs_ActorAtrib_ofs2, $d3, 'ptr')
Global $_ActorAtrib_3 = _MemoryRead($_ActorAtrib_2 + $ofs_ActorAtrib_ofs3, $d3, 'ptr')
Global $_ActorAtrib_4 = _MemoryRead($_ActorAtrib_3, $d3, 'ptr')
Global $_ActorAtrib_Count = $_ActorAtrib_2 + $ofs_ActorAtrib_Count
Global $_LocalActor_1 = _MemoryRead($_ActorAtrib_1 + $ofs_LocalActor_ofs1, $d3, 'ptr')
Global $_LocalActor_2 = _MemoryRead($_LocalActor_1 + $ofs_LocalActor_ofs2, $d3, 'ptr')
Global $_LocalActor_3 = _MemoryRead($_LocalActor_2, $d3, 'ptr')
Global $_LocalActor_Count = $_LocalActor_1 + $ofs_LocalActor_Count
Global $_itrObjectManagerA = _MemoryRead($ofs_objectmanager, $d3, 'ptr')
Global $_itrObjectManagerB = _MemoryRead($_itrObjectManagerA + $ofs__ObjmanagerActorOffsetA, $d3, 'ptr')
Global $_itrObjectManagerCount = $_itrObjectManagerB + $ofs__ObjmanagerActorCount
Global $_itrObjectManagerC = _MemoryRead($_itrObjectManagerB + $ofs__ObjmanagerActorOffsetB, $d3, 'ptr')
Global $_itrObjectManagerD = _MemoryRead($_itrObjectManagerC, $d3, 'ptr')
Global $_itrObjectManagerE = _MemoryRead($_itrObjectManagerD, $d3, 'ptr')
Global $_itrInteractA = _MemoryRead($ofs_InteractBase, $d3, 'ptr')
Global $_itrInteractB = _MemoryRead($_itrInteractA, $d3, 'ptr')
Global $_itrInteractC = _MemoryRead($_itrInteractB, $d3, 'ptr')
Global $_itrInteractD = _MemoryRead($_itrInteractC + $ofs__InteractOffsetA, $d3, 'ptr')
Global $_itrInteractE = $_itrInteractD + $ofs__InteractOffsetB
;IterateObjectList(0)
;Global $Object_File_StringList = IndexSNO($ofs_StringListDef, 0) ;//THIS LIST IS HUGE, NO NEED TO DO IT MORE OFTEN THAN ONCE =)
;$index = _ArraySearch($Object_File_StringList, Hex($_MonsterNameStringListID), 0, 0, 0, 1, 1, 1)
;If $index = -1 Then
; _log("index equal ")
;Return False
;EndIf
;Global $StringListDB = IndexStringList($Object_File_StringList[$index][0]) ;$StringListDB is debricated in this code
;$index = _ArraySearch($Object_File_StringList, Hex($_GizmoNameStringListID), 0, 0, 0, 1, 1, 1)
;If $index > -1 Then
; IndexStringList($Object_File_StringList[$index][0])
;EndIf
If LocateMyToon() Then
Global $ClickToMoveMain = _MemoryRead($_Myoffset + $ofs__ObjmanagerActorLinkToCTM, $d3, 'ptr')
Global $ClickToMoveRotation = $ClickToMoveMain + $RotationOffset
Global $ClickToMoveCurX = $ClickToMoveMain + $CurrentX
Global $ClickToMoveCurY = $ClickToMoveMain + $CurrentY
Global $ClickToMoveCurZ = $ClickToMoveMain + $CurrentZ
Global $ClickToMoveToX = $ClickToMoveMain + $MoveToXoffset
Global $ClickToMoveToY = $ClickToMoveMain + $MoveToYoffset
Global $ClickToMoveToZ = $ClickToMoveMain + $MoveToZoffset
Global $ClickToMoveToggle = $ClickToMoveMain + $ToggleMove
Global $ClickToMoveFix = $ClickToMoveMain + $FixSpeed
Return True
Else
Return False
EndIf
EndFunc ;==>offsetlist
;;--------------------------------------------------------------------------------
;; IterateAllObjectList()
;; Description: Iterate object even if they dont have guid, also provide true names
;;--------------------------------------------------------------------------------
Func IterateAllObjectList($_displayInfo)
If $_displayInfo = 1 Then ConsoleWrite("-----Iterating through Actors------" & @CRLF)
If $_displayInfo = 1 Then ConsoleWrite("First Actor located at: " & $_itrObjectManagerD & @CRLF)
$_CurOffset = $_itrObjectManagerD
$_Count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
Dim $OBJ[$_Count + 1][10]
If $_displayInfo = 1 Then ConsoleWrite("Number of Actors : " & $_Count & @CRLF)
For $i = 0 To $_Count Step +1
$_GUID = _MemoryRead($_CurOffset + 0x4, $d3, 'ptr')
$_NAME = _MemoryRead($_CurOffset + 0x8, $d3, 'char[64]')
$_POS_X = _MemoryRead($_CurOffset + 0xB0, $d3, 'float')
$_POS_Y = _MemoryRead($_CurOffset + 0xB4, $d3, 'float')
$_POS_Z = _MemoryRead($_CurOffset + 0xB8, $d3, 'float')
$_DATA = _MemoryRead($_CurOffset + 0x200, $d3, 'int')
$_DATA2 = _MemoryRead($_CurOffset + 0x1D0, $d3, 'int')
$_DATA3 = _MemoryRead($_CurOffset + 0x1C4, $d3, 'int')
$CurrentLoc = GetCurrentPos()
$xd = $_POS_X - $CurrentLoc[0]
$yd = $_POS_Y - $CurrentLoc[1]
$zd = $_POS_Z - $CurrentLoc[2]
$Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
$OBJ[$i][0] = $i
$OBJ[$i][1] = $_GUID
$OBJ[$i][2] = $_NAME
$OBJ[$i][3] = $_POS_X
$OBJ[$i][4] = $_POS_Y
$OBJ[$i][5] = $_POS_Z
$OBJ[$i][6] = $_DATA
$OBJ[$i][7] = $_DATA2
$OBJ[$i][8] = $Distance
$OBJ[$i][9] = $_CurOffset
If $_displayInfo = 1 Then ConsoleWrite($i & @TAB & " : " & $_CurOffset & " " & $_GUID & " : " & $_DATA & " " & $_DATA2 & " " & @TAB & $_POS_X & " " & $_POS_Y & " " & $_POS_Z & " Dist: " & $Distance & @TAB & $_NAME & " data3: " & $_DATA3 & @CRLF)
;if $_displayINFO = 1 then ConsoleWrite($i & @TAB&" : " & $_POS_X & @TAB& $_POS_Y & @TAB & $_POS_Z & @TAB& $_NAME & @crlf)
$_CurOffset = $_CurOffset + $_ObjmanagerStrucSize
Next
Return $OBJ
EndFunc ;==>IterateAllObjectList
;;--------------------------------------------------------------------------------
;; IterateObjectList()
;;--------------------------------------------------------------------------------
Func IterateObjectList($_displayInfo = 0)
; Local $mesureobj = TimerInit() ;;;;;;;;;;;;;;
If $_displayInfo = 1 Then ConsoleWrite("-----Iterating through Actors------" & @CRLF)
If $_displayInfo = 1 Then ConsoleWrite("First Actor located at: " & $_itrObjectManagerD & @CRLF)
$_CurOffset = $_itrObjectManagerD
$_Count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
Dim $OBJ[$_Count + 1][13]
If $_displayInfo = 1 Then ConsoleWrite("Number of Actors : " & $_Count & @CRLF)
;$init = TimerInit()
For $i = 0 To $_Count Step +1
$_GUID = _MemoryRead($_CurOffset + 0x4, $d3, 'ptr')
If $_GUID = 0xffffffff Then ;no need to go through objects without a GUID!
$_PROXY_NAME = -1
$_REAL_NAME = -1
$_ACTORLINK = -1
$_POS_X = -1
$_POS_Y = -1
$_POS_Z = -1
$_DATA = -1
$_DATA2 = -1
Else
$_PROXY_NAME = _MemoryRead($_CurOffset + 0x8, $d3, 'char[64]')
$TmpString = StringSplit($_PROXY_NAME, "-")
If IsDeclared("__" & $TmpString[1]) Then
$_REAL_NAME = Eval("__" & $TmpString[1])
Else
$_REAL_NAME = $_PROXY_NAME
EndIf
$_ACTORLINK = _MemoryRead($_CurOffset + 0x88, $d3, 'ptr')
$_POS_X = _MemoryRead($_CurOffset + 0xB0, $d3, 'float')
$_POS_Y = _MemoryRead($_CurOffset + 0xB4, $d3, 'float')
$_POS_Z = _MemoryRead($_CurOffset + 0xB8, $d3, 'float')
$_DATA = _MemoryRead($_CurOffset + 0x200, $d3, 'int')
$_DATA2 = _MemoryRead($_CurOffset + 0x1D0, $d3, 'int')
If $_displayInfo = 1 Then ConsoleWrite($i & @TAB & " : " & $_CurOffset & " " & $_GUID & " " & $_ACTORLINK & " : " & $_DATA & " " & $_DATA2 & " " & @TAB & $_POS_X & " " & $_POS_Y & " " & $_POS_Z & @TAB & $_REAL_NAME & @CRLF)
EndIf
;Im too lazy to do this but the following code needs cleanup and restructure more than anything.
;You want to include all the data into this one structure rather than having it at multiple locations
;and the useless things should be removed.
$CurrentLoc = GetCurrentPos()
$xd = $_POS_X - $CurrentLoc[0]
$yd = $_POS_Y - $CurrentLoc[1]
$zd = $_POS_Z - $CurrentLoc[2]
$Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
$OBJ[$i][0] = $_CurOffset
$OBJ[$i][1] = $_GUID
$OBJ[$i][2] = $_PROXY_NAME
$OBJ[$i][3] = $_POS_X
$OBJ[$i][4] = $_POS_Y
$OBJ[$i][5] = $_POS_Z
$OBJ[$i][6] = $_DATA
$OBJ[$i][7] = $_DATA2
$OBJ[$i][8] = $Distance
$OBJ[$i][9] = $_ACTORLINK
$OBJ[$i][10] = $_REAL_NAME
$OBJ[$i][11] = -1
$OBJ[$i][12] = -1
$_CurOffset = $_CurOffset + $_ObjmanagerStrucSize
Next
;$OBJv2 = LinkActors($OBJ) ;//Would be a waste to do this in the main operation so we add more data to the object here after the main operation.
IterateLocalActor()
; Local $difmesureobj = TimerDiff($mesureobj) ;;;;;;;;;;;;;
;ConsoleWrite("Mesure iterOBJ :" & $difmesureobj &@crlf) ;FOR DEBUGGING;;;;;;;;;;;;
Return $OBJ
EndFunc ;==>IterateObjectList
;;--------------------------------------------------------------------------------
;; Function to iterate all objects()
;;--------------------------------------------------------------------------------
Func startIterateObjectsList(ByRef $index, ByRef $offset, ByRef $count)
$count = _MemoryRead($_itrObjectManagerCount, $d3, 'int')
$index = 0
$offset = $_itrObjectManagerD
EndFunc ;==>startIterateObjectsList
Func iterateObjectsList(ByRef $index, ByRef $offset, ByRef $count, ByRef $item)
While 1
If $index > $count Then Return False
$index += 1
$item[0] = _MemoryRead($offset + 0x4, $d3, 'ptr') ; GUID
$item[1] = _MemoryRead($offset + 0x8, $d3, 'char[64]') ; Name
$item[2] = _MemoryRead($offset + 0xB0, $d3, 'float') ; PosX
$item[3] = _MemoryRead($offset + 0xB4, $d3, 'float') ; PosY
$item[4] = _MemoryRead($offset + 0xB8, $d3, 'float') ; PosZ
$item[5] = _MemoryRead($offset + 0x200, $d3, 'int') ; Data1
$item[6] = _MemoryRead($offset + 0x1D0, $d3, 'int') ; Data2
$item[7] = _MemoryRead($offset + 0x1C4, $d3, 'int') ; Data3
$item[8] = $offset ; Current Offset
$item[9] = getDistance($item[2], $item[3], $item[4]) ; Distance
$offset = $offset + $_ObjmanagerStrucSize
Return True
WEnd
EndFunc ;==>iterateObjectsList
;;--------------------------------------------------------------------------------
;; FromD3toScreenCoords()
;;--------------------------------------------------------------------------------
Func FromD3toScreenCoords($_x, $_y, $_z)
Dim $return[2]
$size = WinGetClientSize("[CLASS:D3 Main Window Class]")
$resolutionX = $size[0]
$resolutionY = $size[1]
$aspectChange = ($resolutionX / $resolutionY) / (800 / 600)
$CurrentLoc = GetCurrentPos()
$xd = $_x - $CurrentLoc[0]
$yd = $_y - $CurrentLoc[1]
$zd = $_z - $CurrentLoc[2]
$w = -0.515 * $xd + - 0.514 * $yd + - 0.686 * $zd + 97.985
$X = (-1.682 * $xd + 1.683 * $yd + 0 * $zd + 7.045E-3) / $w
$Y = (-1.54 * $xd + - 1.539 * $yd + 2.307 * $zd + 6.161) / $w
$Z = (-0.515 * $xd + - 0.514 * $yd + - 0.686 * $zd + 97.002) / $w
$X /= $aspectChange
While Abs($X) >= 1 Or Abs($Y) >= 0.7 Or $Z <= 0
; specified point is not on screen
$xd = $xd / 2
$yd = $yd / 2
$zd = $zd / 2
$w = -0.515 * $xd + - 0.514 * $yd + - 0.686 * $zd + 97.985
$X = (-1.682 * $xd + 1.683 * $yd + 0 * $zd + 7.045E-3) / $w
$Y = (-1.54 * $xd + - 1.539 * $yd + 2.307 * $zd + 6.161) / $w
$Z = (-0.515 * $xd + - 0.514 * $yd + - 0.686 * $zd + 97.002) / $w
$X /= $aspectChange
WEnd
$return[0] = ($X + 1) / 2 * $resolutionX
$return[1] = (1 - $Y) / 2 * $resolutionY
Return $return
EndFunc ;==>FromD3toScreenCoords
;;--------------------------------------------------------------------------------
;; UiRatio()
;;--------------------------------------------------------------------------------
Func UiRatio($_x, $_y)
Dim $return[2]
$size = WinGetClientSize("[CLASS:D3 Main Window Class]")
$return[0] = $size[1] * ($_x / 600)
$return[1] = $size[1] * ($_y / 600)
Return $return
EndFunc ;==>UiRatio
;;--------------------------------------------------------------------------------
;; GetCurrentPos()
;;--------------------------------------------------------------------------------
Func GetCurrentPos()
; Local $mesurepos = TimerInit() ;;;;;;;;;;;;;;
Dim $return[3]
$return[0] = _MemoryRead($_Myoffset + 0x0A0, $d3, 'float')
$return[1] = _MemoryRead($_Myoffset + 0x0A4, $d3, 'float')
$return[2] = _MemoryRead($_Myoffset + 0x0A8, $d3, 'float')
; Local $difmesurepos = TimerDiff($mesurepos) ;;;;;;;;;;;;;
;ConsoleWrite("Mesure getcurrentpos :" & $difmesurepos &@crlf) ;FOR DEBUGGING;;;;;;;;;;;;
Return $return
EndFunc ;==>GetCurrentPos
;;--------------------------------------------------------------------------------
;; MoveToPos()
;;--------------------------------------------------------------------------------
Func MoveToPos($_x, $_y, $_z, $_a, $m_range)
Local $TimeOut = TimerInit()
$grabtimeout = 0
$killtimeout = 0
If _playerdead() Or $GameOverTime = True Or $GameFailed = 1 Or $SkippedMove > 6 Then
$GameFailed = 1
Return
EndIf
Local $toggletry = 0
Global $lastwp_x = $_x
Global $lastwp_y = $_y
Global $lastwp_z = $_z
If $_a = 1 Then Attack($a_range, $monsterList)
$Coords = FromD3toScreenCoords($_x, $_y, $_z)
MouseMove($Coords[0], $Coords[1], 3)
$LastCP = GetCurrentPos()
MouseDown("middle")
Sleep(10)
While 1
GameOverTime()
If $GameOverTime = True Then
ExitLoop
EndIf
$CurrentLoc = GetCurrentPos()
$xd = $lastwp_x - $CurrentLoc[0]
$yd = $lastwp_y - $CurrentLoc[1]
$zd = $lastwp_z - $CurrentLoc[2]
$Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
If $Distance < $m_range Then ExitLoop
;If _MemoryRead($ClickToMoveToggle, $d3, 'float') = 0 Then ExitLoop
Local $angle = 1
Local $Radius = 25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While _MemoryRead($ClickToMoveToggle, $d3, 'float') = 0
;_log("Togglemove : " & _MemoryRead($ClickToMoveToggle, $d3, 'float'))
$Coords = FromD3toScreenCoords($_x, $_y, $_z)
$angle += $Step
$Radius += 45
;MouseMove($Coords[0] - (Cos($angle) * $Radius), $Coords[1] - (Sin($angle) * $Radius), 3)
; ci desssous du dirty code pour eviter de cliquer n'importe ou hos de la fenetre du jeu
$Coords[0] = $Coords[0] - (Cos($angle) * $Radius)
$Coords[1] = $Coords[1] - (Sin($angle) * $Radius)
If $Coords[0] > 790 Then
$Coords[0] = 790
ElseIf $Coords[0] < 40 Then ;car on a pas l'envie de cliquer dans les icone du chat
$Coords[0] = 40
EndIf
If $Coords[1] > 540 Then ;car on a pas l'envie de cliquer dans la bare des skills
$Coords[1] = 540
ElseIf $Coords[1] < 10 Then
$Coords[1] = 10
EndIf
MouseMove($Coords[0], $Coords[1], 3)
$toggletry += 1
;_log("Tryin move :" & " x:" & $_x & " y:" & $_y & "coords: " & $Coords[0] & "-" & $Coords[1] & " angle: " & $angle & " Toggle try: " & $toggletry)
If _playerdead_revive() Then
ExitLoop 2
EndIf
If $angle >= 2.0 * $PI Or $toggletry > 9 Or _playerdead() Then
$SkippedMove += 1
_log("Toggle try: " & $toggletry & " Movement Skipped : " & $SkippedMove)
ExitLoop 2 ; le 2 signifie que l'on quitte 2 loop
EndIf
Sleep(10)
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Sleep(10)
$Coords = FromD3toScreenCoords($lastwp_x, $lastwp_y, $lastwp_z)
;ConsoleWrite("currentloc: " & $_Myoffset & " - "&$CurrentLoc[0] & " : " & $CurrentLoc[1] & " : " & $CurrentLoc[2] &@CRLF)
;ConsoleWrite("distance/m range: " & $Distance & " : " & $m_range & @CRLF)
If $_a = 1 And GetDistance($LastCP[0], $LastCP[1], $LastCP[2]) >= $a_range / 2 Then
MouseUp("middle")
$LastCP = GetCurrentPos()
If $_a = 1 Then Attack($a_range, $monsterList)
;ConsoleWrite("Last check: " & $Distance & @CRLF)
MouseMove($Coords[0], $Coords[1], 3)
MouseDown("middle")
EndIf
MouseMove($Coords[0], $Coords[1], 3)
If TimerDiff($TimeOut) > 75000 Then
_log("MoveToPos Timed out ! ! ! ")
If _checkdisconnect() Then
$GameFailed = 1
EndIf
ExitLoop
EndIf
WEnd
MouseUp("middle")
;;
;Sleep(100)
EndFunc ;==>MoveToPos
;;--------------------------------------------------------------------------------
;; Interact()
;;--------------------------------------------------------------------------------
Func Interact($_x, $_y, $_z)
; MoveToPos($_x, $_y, $_z, 0, 25)
$Coords = FromD3toScreenCoords($_x, $_y, $_z)
MouseClick("left", $Coords[0], $Coords[1], 1, 6)
While _MemoryRead($_itrInteractE + $ofs__InteractOffsetUNK2, $d3, 'int') = 1
Sleep(100)
WEnd
EndFunc ;==>Interact
;;--------------------------------------------------------------------------------
;; Approach() Approach a NPC without left clicking
;;--------------------------------------------------------------------------------
Func Approach($_x, $_y, $_z)
; MoveToPos($_x, $_y, $_z, 0, 25)
While _MemoryRead($_itrInteractE + $ofs__InteractOffsetUNK2, $d3, 'int') = 1
Sleep(100)
WEnd
EndFunc ;==>Approach
;;--------------------------------------------------------------------------------
;; InteractByActorName()
;;--------------------------------------------------------------------------------
Func InteractByActorName($a_name, $dist = 300)
Local $index, $offset, $count, $item[10], $foundobject = 0
Local $maxtry = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item) And _playerdead() = False
If StringInStr($item[1], $a_name) And $item[9] < $dist Then
_log($item[1] & " distance : " & $item[9])
While getDistance($item[2], $item[3], $item[4]) > 40 And $maxtry <= 15
$Coords = FromD3toScreenCoords($item[2], $item[3], $item[4])
MouseClick("middle", $Coords[0], $Coords[1], 1, 10)
$maxtry += 1
_log('interactbyactor: click x : ' & $Coords[0] & " y : " & $Coords[1])
Sleep(800)
WEnd
Sleep(800)
Interact($item[2], $item[3], $item[4])
$foundobject = 1
Sleep(100)
ExitLoop
EndIf
WEnd
Return $foundobject
EndFunc ;==>InteractByActorName
;;--------------------------------------------------------------------------------
;; GetLifep()
;;--------------------------------------------------------------------------------
Func GetLifep()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "HealthBall_liquid") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetLifep
;;--------------------------------------------------------------------------------
;; Attack()
;;--------------------------------------------------------------------------------
Func Attack($range, $monsterList)
; _log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)
; _log('If _playerdead() or ($gamefailed = 1)')
If _playerdead_revive() Then
Return
EndIf
If _playerdead() Or ($GameFailed = 1) Then
$GameFailed = 1
_log("Return Cuz : If _playerdead or gamefailed ")
Return
EndIf
Local $IgnoreList = ""
While 1
If _playerdead_revive() Then
ExitLoop
EndIf
If $GameFailed = 0 Then
$foundobject = 0
Local $index, $offset, $count, $item[10]
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If $item[0] <> "" And $item[0] <> 0xFFFFFFFF And $item[9] < $g_range And StringInStr($IgnoreList, $item[8]) == 0 And StringInStr($IgnoreItemList, $item[1]) = 0 and checkfromlist($shrinebanlist, $item[8]) = 0 Then
If stringInStr($item[1],"shrine") Then
If IterateActorAtribs($item[0], $Atrib_gizmo_state) <> 1 Then
If shrine($item[1], $item[8], $item[0]) = false Then
$shrinebanlist = $shrinebanlist &"|"& $item[8]
Endif
Endif
Endif
If checkFromList($monsterList, $item[1]) And $item[6] <> -1 And $item[9] < $range Or (checkFromList($monsterList, $item[1]) And (StringInStr($item[1], "brickhouse_") Or StringInStr($item[1], "goblin") Or StringInStr($item[1], "woodwraith_")) And $item[9] < $range) Then
; we have a monster
If IterateActorAtribs($item[0], $Atrib_Hitpoints_Cur) > 0 And IterateActorAtribs($item[0], $Atrib_Invulnerable) = 0 Then
$foundobject = 1
If KillMob($item[1], $item[8], $item[0]) = False Then
_log('ignoring ' & $item[1])
$IgnoreList = $IgnoreList & $item[8]
;_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)
If $killtimeout > 2 Or $grabtimeout > 2 Then
_log("_checkdisconnect Cuz :If $killtimeout > 2 or $grabtimeout > 2 Then")
If _checkdisconnect() Or _playerdead() Then
$GameFailed = 1
EndIf
EndIf
EndIf
Else
_log('ignoring ' & $item[1])
$IgnoreList = $IgnoreList & $item[8]
;_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)
If $killtimeout > 2 Or $grabtimeout > 2 Then
If _checkdisconnect() Or _playerdead() Then
$GameFailed = 1
EndIf
EndIf
EndIf
;ElseIf $item[5] <> 0 And $item[6] = 5 Then 1,05 test
ElseIf ($item[5] = 2 And $item[6] = -1) or (StringInStr($item[1], "orb") and StringInStr($item[1], "unique")) Then ;1,04
; we have a loot
$grabit = False
If _MemoryRead($item[8] + 0x4, $d3, 'ptr') <> 0xFFFFFFFF Then
ConsoleWrite("Checking " & $item[1] & @CRLF)
$itemDestination = CheckItem($item[0], $item[1])
If $itemDestination == "Stash" Or $itemDestination == "Salvage" Or ($itemDestination == "Inventory" and $takepot = True) Then
; this loot is interesting
$foundobject = 1
If Grabit($item[1], $item[8]) = False Then
_log('ignoring ' & $item[1])
$IgnoreList = $IgnoreList & $item[8]
;_log("Grabtimeout : " & $grabtimeout & " killtimeout: "& $killtimeout)
If $killtimeout > 2 Or $grabtimeout > 2 Then
If _checkdisconnect() Or _playerdead() Then
_log('_checkdisconnect A or player D')
$GameFailed = 1
EndIf
EndIf
EndIf
Else
If checkFromList($monsterList, $item[1]) = False Then
$IgnoreItemList = $IgnoreItemList & $item[1] & "-"
;_log('ignoring ' & $item[8] & " : " & $item[1] & " :::::" &$IgnoreItemList)
EndIf
EndIf
EndIf
EndIf
EndIf
WEnd
If $foundobject = 0 Then
ExitLoop
EndIf
Else
_log("$gamefailed = 1 ExitLoop or player dead")
ExitLoop
EndIf
WEnd
EndFunc ;==>Attack
;;--------------------------------------------------------------------------------
;; KillMob()
;;--------------------------------------------------------------------------------
Func KillMob($name, $offset, $guid)
$return = True
$begin = TimerInit()
;Local $IgnorePoint = 9000 ; Been remplaced by a_time in settings.ini <-- If something is not grabbed/killed in this time we give it up
$Coords = FromD3toScreenCoords(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
MouseMove($Coords[0], $Coords[1], 3)
;Send("{SHIFTDOWN}")
MouseDown("left")
;loop the attack until the mob is dead
_log("Attacking : " & $name) ;FOR
While IterateActorAtribs($guid, $Atrib_Hitpoints_Cur) > 0
If _playerdead_revive() then
$return = False
ExitLoop
EndIf
$Coords = FromD3toScreenCoords(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
MouseMove($Coords[0], $Coords[1], 3)
MouseDown("left")
checkForSpell()
;Sleep(10)
If TimerDiff($begin) > $a_time Then
$killtimeout += 1
; after this time, the mob should be dead, otherwise he is probly unkillable
$return = False
ExitLoop
EndIf
WEnd
MouseUp("left")
;Send("{SHIFTUP}")
Return $return
EndFunc ;==>KillMob
;;--------------------------------------------------------------------------------
;; Grabit()
;;--------------------------------------------------------------------------------
Func Grabit($name, $offset)
$begin = TimerInit()
Dim $CoordVerif[3]
; Local $IgnorePoint = 7500; Remplaced by var g_time <-- If something is not grabbed/killed in this time we give it up
ConsoleWrite("Grabbing :" & ($name) & @CRLF) ;FOR DEBUGGING
If (StringInStr($name, "gold")) Then
$Coords = FromD3toScreenCoords(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
$CoordVerif[0] = _MemoryRead($offset + 0xB0, $d3, 'float')
$CoordVerif[1] = _MemoryRead($offset + 0xB4, $d3, 'float')
$CoordVerif[2] = _MemoryRead($offset + 0xB8, $d3, 'float')
MouseClick("middle", $Coords[0], $Coords[1], 1, 5)
Else
Interact(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
EndIf
While _MemoryRead($offset + 0x4, $d3, 'ptr') <> 0xFFFFFFFF
If _playerdead_revive() then
$return = False
ExitLoop
EndIf
If TimerDiff($begin) > $g_time Then
$grabtimeout += 1
; After this time we should already had the item
Return False
EndIf
If (StringInStr($name, "gold")) Then
$Coords = FromD3toScreenCoords(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
;Check if the coord X y z havn't changed.
If ($CoordVerif[0] <> _MemoryRead($offset + 0xB0, $d3, 'float') Or $CoordVerif[1] <> _MemoryRead($offset + 0xB4, $d3, 'float') Or $CoordVerif[2] <> _MemoryRead($offset + 0xB8, $d3, 'float')) Then
_log("Fake GOLD")
Return False
Else
MouseClick("middle", $Coords[0], $Coords[1], 1, 5)
EndIf
Else
Interact(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
EndIf
Sleep(50)
WEnd
Return True
EndFunc ;==>Grabit
;;--------------------------------------------------------------------------------
;; checkForPotion()
;;--------------------------------------------------------------------------------
Func checkForPotion()
$life = GetLifep()
$diff = TimerDiff($timeforpotion)
If $life < $LifeForPotion / 100 And $diff > 1500 Then
Send("q")
$timeforpotion = TimerInit()
EndIf
EndFunc ;==>checkForPotion
;;--------------------------------------------------------------------------------
;; checkFromList()
;;--------------------------------------------------------------------------------
Func checkFromList($list, $compare, $delimiter = '|')
Local $arrayList = StringSplit($list, $delimiter)
For $i = 1 To $arrayList[0]
If StringInStr($compare, $arrayList[$i]) Then
Return 1
EndIf
Next
Return 0
EndFunc ;==>checkFromList
;;--------------------------------------------------------------------------------
;; SkipDialog()
;;--------------------------------------------------------------------------------
Func SkipDialog($_Count)
For $i = 1 To $_Count
Send("{SPACE}")
Sleep(100)
Next
EndFunc ;==>SkipDialog
;;--------------------------------------------------------------------------------
;; TakeWP()
;;--------------------------------------------------------------------------------
Func TakeWP($tarChapter, $tarNum, $curChapter, $curNum)
If $GameFailed = 0 Then
Local $Waypoint
While Not offsetlist()
Sleep(10)
WEnd
If FindActor("waypoint_arrival_ribbonGeo", 80) Then
$Waypoint = "waypoint_arrival_ribbonGeo"
ElseIf FindActor("waypoint_neutral_ringGlow", 80) Then
$Waypoint = "waypoint_neutral_ringGlow"
ElseIf FindActor("Waypoint_Town", 80) Then
$Waypoint = "Waypoint_Town"
Else
$Waypoint = "waypoint"
EndIf
InteractByActorName($Waypoint)
Sleep(650)
Local $wptry = 0
While _checkWPopen() = False And _playerdead() = False
If $wptry <= 4 Then
_log('Fail to open wp')
$wptry = $wptry + 1
InteractByActorName($Waypoint)
EndIf
If $wptry > 4 Then
$GameFailed = 1
_log('Failed to open wp after 3 try')
ExitLoop
EndIf
WEnd
If $tarChapter <> $curChapter Or ($tarChapter = $curChapter And $tarChapter < $curChapter) Then
For $i = 0 To $tarChapter - 1
$coord = UiRatio(35, 100 + ($i * 12.5))
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
Next
$coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + ($tarNum * 32))
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
EndIf
If $tarChapter = $curChapter And $tarChapter > $curChapter Then
For $i = 0 To $tarChapter - 1
$coord = UiRatio(35, 100 + ($i * 12.5))
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Close chapters
Next
$coord = UiRatio(145, 100 + ($tarChapter * 12.5) + 23 + 12 + ($tarNum * 32))
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Click wp
EndIf
Sleep(1500)
While Not offsetlist()
Sleep(10)
WEnd
$SkippedMove = 0 ;reset ouur skipped move count cuz we should be in brand new area
EndIf
EndFunc ;==>TakeWP
;;--------------------------------------------------------------------------------
;; _resumegame()
;;--------------------------------------------------------------------------------
Func _resumegame()
_log("Resume Game")
Sleep(Random(500, 1000, 1))
_randomclick(106, 233)
Sleep(4000)
EndFunc ;==>_resumegame
;;--------------------------------------------------------------------------------
;; _leavegame()
;;--------------------------------------------------------------------------------
Func _leavegame()
If _ingame() Then
_log("Leave Game")
Send("{SPACE}") ; to make sure everything is closed
Send("{ESCAPE}")
Sleep(Random(200, 300, 1))
While _escmenu() = False
Send("{ESCAPE}")
Sleep(Random(200, 300, 1))
WEnd
_randomclick(420, 323)
Sleep(Random(500, 1000, 1))
EndIf
EndFunc ;==>_leavegame
;;--------------------------------------------------------------------------------
;; Repair()
;;--------------------------------------------------------------------------------
Func Repair()
InteractByActorName($RepairVendor)
Sleep(700)
Local $vendortry = 0
While _checkVendoropen() = False
If $vendortry <= 4 Then
_log('Fail to open vendor')
$vendortry = $vendortry + 1
InteractByActorName($RepairVendor)
EndIf
If $vendortry > 4 Then
Send("{PRINTSCREEN}")
Sleep(200)
_log('Failed to open Vendor after 4 try')
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)
MsgBox(0, "Impossible d'ouvrir le vendeur :", "SVP, veuillez reporter ce problème sur le forum. Erreur : v001 ")
Terminate()
ExitLoop
EndIf
WEnd
GetRepairTab()
$coord = UiRatio(290, 130 + ($RepairTab * 70))
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Repair tab
Sleep(100)
$coord = UiRatio(150, 330)
MouseClick("left", $coord[0], $coord[1], 1, 3) ; Repair Button
Sleep(100)
Send("{SPACE}")
EndFunc ;==>Repair
;;================================================================================
; Function: GetDistance($_x,$_y,$_z)
; Description: Check distance between you and a desired position.
; Parameter(s): $_x,$_y and $_z - the target position
;
; Note(s): Returns a distance in float
;==================================================================================
Func GetDistance($_x, $_y, $_z)
$CurrentLoc = GetCurrentPos()
$xd = $_x - $CurrentLoc[0]
$yd = $_y - $CurrentLoc[1]
$zd = $_z - $CurrentLoc[2]
$Distance = Sqrt($xd * $xd + $yd * $yd + $zd * $zd)
Return $Distance
EndFunc ;==>GetDistance
;;================================================================================
; Function: GetDistance($_x,$_y,$_z)
; Description: Check distance between you and a desired position.
; Parameter(s): $_x,$_y and $_z - the target position
;
; Note(s): Returns a distance in float
;==================================================================================
Func GetMyStats()
Local $index, $offset, $count, $item[4]
startIterateLocalActor($index, $offset, $count)
While iterateLocalActorList($index, $offset, $count, $item)
If StringInStr($item[2], "GoldCoin-") Then
_log("Current GOLD: " & IterateActorAtribs($item[1], $Atrib_ItemStackQuantityLo))
ExitLoop
EndIf
WEnd
_log("Power Disabled: " & IterateActorAtribs($_MyGuid, $Atrib_Magic_Find_Handicap))
_log("Difficulty: " & IterateActorAtribs($_MyGuid, $Atrib_Difficulty))
_log("Act: " & IterateActorAtribs($_MyGuid, $Atrib_Act))
_log("Current Level: " & IterateActorAtribs($_MyGuid, $Atrib_Level))
_log("Strength: " & IterateActorAtribs($_MyGuid, $Atrib_Strength_Total))
_log("Dexterity: " & IterateActorAtribs($_MyGuid, $Atrib_Dexterity_Total))
_log("Inteligence: " & IterateActorAtribs($_MyGuid, $Atrib_Intelligence_Total))
_log("Vitality: " & IterateActorAtribs($_MyGuid, $Atrib_Vitality_Total))
_log("Gold find: " & IterateActorAtribs($_MyGuid, $Atrib_Gold_Find))
_log("Magic find: " & IterateActorAtribs($_MyGuid, $Atrib_Magic_Find))
_log("Pickup Radius : " & IterateActorAtribs($_MyGuid, $Atrib_Gold_PickUp_Radius))
_log("Movement speed : " & IterateActorAtribs($_MyGuid, $Atrib_Movement_Scalar_Capped_Total))
EndFunc ;==>GetMyStats
Func GameOverTime()
Global $timedifmaxgamelength = TimerDiff($timermaxgamelength)
If $timedifmaxgamelength > $maxgamelength Then
_log('game over time !')
Global $GameOverTime = True
EndIf
EndFunc ;==>GameOverTime
Func Terminate()
if $checkx64=1 then
MouseUp("middle")
MouseUp("left")
Send("{SHIFTUP}")
Exit 0
else
WinSetOnTop("[CLASS:D3 Main Window Class]","",0)
If Not FileExists(@ScriptDir & ".\stats") Then
DirCreate(@ScriptDir & ".\stats")
EndIf
$file = FileOpen(@ScriptDir & ".\stats\" & $fichierstat, 1)
FileWriteLine($file, $DebugMessage)
FileClose($file)
MouseUp("middle")
MouseUp("left")
Send("{SHIFTUP}")
Exit 0
endif
EndFunc ;==>Terminate
Func TogglePause()
$Paused = Not $Paused
If $Paused Then
WinSetOnTop("[CLASS:D3 Main Window Class]", "",0)
While $Paused
Sleep(100)
TrayTip("", 'Script is "Paused"', 5)
WEnd
EndIf
CheckWindowD3()
EndFunc ;==>TogglePause
Func _log($text)
ConsoleWrite(@MDAY & "/" & @MON & "/" & @YEAR & " " & @HOUR & ":" & @MIN & ":" & @SEC & " | " & $text & @CRLF)
EndFunc ;==>_log
Func RandSleep($min = 5, $max = 45, $chance = 3)
$randNum = Round(Random(1, 100))
If $randNum <= $chance Then
$sleepTime = Random($min * 1000, $max * 1000)
_log("Sleeping " & $sleepTime & "ms")
For $c = 0 To 10
Sleep($sleepTime / 10)
Next
EndIf
EndFunc ;==>RandSleep
Func _randomclick($X, $Y, $button = "left")
$coord = UiRatio($X, $Y)
MouseClick($button, Random($coord[0] - 3, $coord[0] + 3), Random($coord[1] - 3, $coord[1] + 3))
EndFunc ;==>_randomclick
;;--------------------------------------------------------------------------------
;;############# Speels by Xoum
;;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
;; setChararacter()
;;--------------------------------------------------------------------------------
Func setChararacter($nameChar)
$splitName = StringSplit($nameChar, "_")
$nameCharacter = $splitName[1]
_log($nameCharacter)
EndFunc ;==>setChararacter
;;--------------------------------------------------------------------------------
;; Getfury()
;;--------------------------------------------------------------------------------
Func GetFury()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "furyBall_liquid") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetFury
;;
;--------------------------------------------------------------------------------
;; Gethatred()
;;--------------------------------------------------------------------------------
Func GetHatred()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "hatred") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetHatred
;;
;--------------------------------------------------------------------------------
;; Getdisc()
;;--------------------------------------------------------------------------------
Func GetDisc()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "discipline") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetDisc
;;
;--------------------------------------------------------------------------------
;; Getspirit()
;;--------------------------------------------------------------------------------
Func GetSpirit()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "Monk_Spirit") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetSpirit
;;
;--------------------------------------------------------------------------------
;; Getmana()
;;--------------------------------------------------------------------------------
Func GetMana()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "mana") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetMana
;;
;--------------------------------------------------------------------------------
;; Getarcane()
;;--------------------------------------------------------------------------------
Func GetArcane()
Local $index, $offset, $count, $item[10], $foundobject = 0
startIterateObjectsList($index, $offset, $count)
While iterateObjectsList($index, $offset, $count, $item)
If StringInStr($item[1], "instability") Then
Return _MemoryRead($item[8] + 0x40C, $d3, 'float')
EndIf
WEnd
EndFunc ;==>GetArcane
;;--------------------------------------------------------------------------------
;; checkForSpell()
;;--------------------------------------------------------------------------------
Func checkForSpell()
checkForPotion()
;Local $mesurepot = TimerInit() ;;;;;;;;;;;;;;
Local $source
Local $MaximumSource
Switch $nameCharacter
Case "DemonHunter"
$discipline = GetDisc()
$hatred = GetHatred()
$life = GetLifep()
$diffRightClick = TimerDiff($timeforRightclick)
If $RightClickSpell = "True" And $life <= $LifeForRightClickSpell / 100 And $diffRightClick > $RightClickSpellDelay Then
If $RightClickSpellEnergy <> "" Then
If $RightClickSpellEnergy = "hatred" Then
If $hatred > $RightClickSpellEnergyNeeds / $MaximumHatred Then
MouseClick("right")
$timeforRightclick = TimerInit()
EndIf
Else
If $discipline > $RightClickSpellEnergyNeeds / $MaximumDiscipline Then
MouseClick("right")
$timeforRightclick = TimerInit()
EndIf
EndIf
Else
MouseClick("right")
$timeforRightclick = TimerInit()
EndIf
EndIf
$discipline = GetDisc()
$hatred = GetHatred()
$life = GetLifep()
$diffSpell1 = TimerDiff($timeforSpell1)
If $Spell1Activated = "True" And $life <= $LifeForSpell1 / 100 And $diffSpell1 > $DefayForSpell1 Then
If $EnergySpell1 <> "" Then
If $EnergySpell1 = "hatred" Then
If $hatred > $EnergyNeedsSpell1 / $MaximumHatred Then
Send($KeyForSpell1)
$timeforSpell1 = TimerInit()
EndIf
Else
If $discipline > $EnergyNeedsSpell1 / $MaximumDiscipline Then
Send($KeyForSpell1)
$timeforSpell1 = TimerInit()
EndIf
EndIf
Else
Send($KeyForSpell1)
$timeforSpell1 = TimerInit()
EndIf
EndIf
$discipline = GetDisc()
$hatred = GetHatred()
$life = GetLifep()
$diffSpell2 = TimerDiff($timeforSpell2)
If $Spell2Activated = "True" And $life <= $LifeForSpell2 / 100 And $diffSpell2 > $DefayForSpell2 Then
If $EnergySpell2 <> "" Then
If $EnergySpell2 = "hatred" Then
If $hatred > $EnergyNeedsSpell2 / $MaximumHatred Then
Send($KeyForSpell2)
$timeforSpell2 = TimerInit()
EndIf
Else
If $discipline > $EnergyNeedsSpell2 / $MaximumDiscipline Then
Send($KeyForSpell2)
$timeforSpell2 = TimerInit()
EndIf
EndIf
Else
Send($KeyForSpell2)
$timeforSpell2 = TimerInit()
EndIf
EndIf
$discipline = GetDisc()
$hatred = GetHatred()
$life = GetLifep()
$diffSpell3 = TimerDiff($timeforSpell3)
If $Spell3Activated = "True" And $life <= $LifeForSpell3 / 100 And $diffSpell3 > $DefayForSpell3 Then
If $EnergySpell3 <> "" Then
If $EnergySpell3 = "hatred" Then
If $hatred > $EnergyNeedsSpell3 / $MaximumHatred Then
Send($KeyForSpell3)
$timeforSpell3 = TimerInit()
EndIf
Else
If $discipline > $EnergyNeedsSpell3 / $MaximumDiscipline Then
Send($KeyForSpell3)
$timeforSpell3 = TimerInit()
EndIf
EndIf
Else
Send($KeyForSpell3)
$timeforSpell3 = TimerInit()
EndIf
EndIf
$discipline = GetDisc()
$hatred = GetHatred()
$life = GetLifep()
$diffSpell4 = TimerDiff($timeforSpell4)
If $Spell4Activated = "True" And $life <= $LifeForSpell4 / 100 And $diffSpell4 > $DefayForSpell4 Then
If $EnergySpell4 <> "" Then
If $EnergySpell4 = "hatred" Then
If $hatred > $EnergyNeedsSpell4 / $MaximumHatred Then
Send($KeyForSpell4)
$timeforSpell4 = TimerInit()
EndIf
Else
If $discipline > $EnergyNeedsSpell4 / $MaximumDiscipline Then
Send($KeyForSpell4)
$timeforSpell4 = TimerInit()
EndIf
EndIf
Else
Send($KeyForSpell4)
$timeforSpell4 = TimerInit()
EndIf
EndIf
Case "Monk"
$MaximumSource = $MaximumSpirit
actionForSpell($MaximumSource)
Case "Barbarian"
$MaximumSource = $MaximumFury
actionForSpell($MaximumSource)
Case "wizard"
$MaximumSource = $MaximumArcane
actionForSpell($MaximumSource)
Case "WitchDoctor"
$MaximumSource = $MaximumMana
actionForSpell($MaximumSource)
EndSwitch
EndFunc ;==>checkForSpell
Func actionForSpell($MaximumSource)
$life = GetLifep()
Switch $nameCharacter
Case "Monk"
$source = GetSpirit()
Case "Barbarian"
$source = GetFury()
Case "wizard"
$source = GetArcane()
Case "WitchDoctor"
$source = GetMana()
EndSwitch
$diffRightClick = TimerDiff($timeforRightclick)
If $RightClickSpell = "True" And $life <= $LifeForRightClickSpell / 100 And $diffRightClick > $RightClickSpellDelay Then
If $RightClickSpellEnergy <> "" Then
If $source > $RightClickSpellEnergyNeeds / $MaximumSource Then
MouseClick("right")
$timeforRightclick = TimerInit()
EndIf
Else
MouseClick("right")
$timeforRightclick = TimerInit()
EndIf
EndIf
$life = GetLifep()
Switch $nameCharacter
Case "Monk"
$source = GetSpirit()
Case "Barbarian"
$source = GetFury()
Case "wizard"
$source = GetArcane()
Case "WitchDoctor"
$source = GetMana()
EndSwitch
$diffSpell1 = TimerDiff($timeforSpell1)
If $Spell1Activated = "True" And $life <= $LifeForSpell1 / 100 And $diffSpell1 > $DefayForSpell1 Then
If $EnergySpell1 <> "" Then
If $source > $EnergyNeedsSpell1 / $MaximumSource Then
Send($KeyForSpell1)
$timeforSpell1 = TimerInit()
EndIf
Else
Send($KeyForSpell1)
$timeforSpell1 = TimerInit()
EndIf
EndIf
$life = GetLifep()
Switch $nameCharacter
Case "Monk"
$source = GetSpirit()
Case "Barbarian"
$source = GetFury()
Case "wizard"
$source = GetArcane()
Case "WitchDoctor"
$source = GetMana()
EndSwitch
$diffSpell2 = TimerDiff($timeforSpell2)
If $Spell2Activated = "True" And $life <= $LifeForSpell2 / 100 And $diffSpell2 > $DefayForSpell2 Then
If $EnergySpell2 <> "" Then
If $source > $EnergyNeedsSpell2 / $MaximumSource Then
Send($KeyForSpell2)
$timeforSpell2 = TimerInit()
EndIf
Else
Send($KeyForSpell2)
$timeforSpell2 = TimerInit()
EndIf
EndIf
$life = GetLifep()
Switch $nameCharacter
Case "Monk"
$source = GetSpirit()
Case "Barbarian"
$source = GetFury()
Case "wizard"
$source = GetArcane()
Case "WitchDoctor"
$source = GetMana()
EndSwitch
$diffSpell3 = TimerDiff($timeforSpell3)
If $Spell3Activated = "True" And $life <= $LifeForSpell3 / 100 And $diffSpell3 > $DefayForSpell3 Then
If $EnergySpell3 <> "" Then
If $source > $EnergyNeedsSpell3 / $MaximumSource Then
Send($KeyForSpell3)
$timeforSpell3 = TimerInit()
EndIf
Else
Send($KeyForSpell3)
$timeforSpell3 = TimerInit()
EndIf
EndIf
$life = GetLifep()
Switch $nameCharacter
Case "Monk"
$source = GetSpirit()
Case "Barbarian"
$source = GetFury()
Case "wizard"
$source = GetArcane()
Case "WitchDoctor"
$source = GetMana()
EndSwitch
$diffSpell4 = TimerDiff($timeforSpell4)
If $Spell4Activated = "True" And $life <= $LifeForSpell4 / 100 And $diffSpell4 > $DefayForSpell4 Then
If $EnergySpell4 <> "" Then
If $source > $EnergyNeedsSpell4 / $MaximumSource Then
Send($KeyForSpell4)
$timeforSpell4 = TimerInit()
EndIf
Else
Send($KeyForSpell4)
$timeforSpell4 = TimerInit()
EndIf
EndIf
EndFunc ;==>actionForSpell
;;--------------------------------------------------------------------------------
;;############# Stats by YoPens
;;--------------------------------------------------------------------------------
Func StatsDisplay()
Local $index, $offset, $count, $item[4]
startIterateLocalActor($index, $offset, $count)
While iterateLocalActorList($index, $offset, $count, $item)
If StringInStr($item[1], "GoldCoin-") Then
$GOLD = IterateActorAtribs($item[0], $Atrib_ItemStackQuantityLo)
ExitLoop
EndIf
WEnd
If $Totalruns = 1 Then
$GOLDINI = $GOLD
$begin_timer_stat = TimerInit()
$GF = Ceiling(IterateActorAtribs($_MyGuid, $Atrib_Gold_Find) * 100)
$MF = Ceiling(IterateActorAtribs($_MyGuid, $Atrib_Magic_Find) * 100)
$PR = IterateActorAtribs($_MyGuid, $Atrib_Gold_PickUp_Radius)
$MS = (IterateActorAtribs($_MyGuid, $Atrib_Movement_Scalar_Capped_Total) - 1) * 100
Else
$GOLDInthepocket = $GOLD - $GOLDINI
$GOLDMOY = $GOLDInthepocket / ($Totalruns - 1)
$dif_timer_stat = TimerDiff($begin_timer_stat)
$GOLDMOYbyH = $GOLDInthepocket * 3600000 / $dif_timer_stat
EndIf
;stat XP
;Xp nécessaire pour passer un niveau de paragon
If $Totalruns = 1 Then
Global $level[102]
$level[1] = 7200000
$level[2] = 8640000
$level[3] = 10080000
$level[4] = 11520000
$level[5] = 12960000
$level[6] = 14400000
$level[7] = 15840000
$level[8] = 17280000
$level[9] = 18720000
$level[10] = 20160000
$level[11] = 21600000
$level[12] = 23040000
$level[13] = 24480000
$level[14] = 25920000
$level[15] = 27360000
$level[16] = 28800000
$level[17] = 30240000
$level[18] = 31680000
$level[19] = 33120000
$level[20] = 34560000
$level[21] = 36000000
$level[22] = 37440000
$level[23] = 38880000
$level[24] = 40320000
$level[25] = 41760000
$level[26] = 43200000
$level[27] = 44640000
$level[28] = 46080000
$level[29] = 47520000
$level[30] = 48960000
$level[31] = 50400000
$level[32] = 51840000
$level[33] = 53280000
$level[34] = 54720000
$level[35] = 56160000
$level[36] = 57600000
$level[37] = 59040000
$level[38] = 60480000
$level[39] = 61920000
$level[40] = 63360000
$level[41] = 64800000
$level[42] = 66240000
$level[43] = 67680000
$level[44] = 69120000
$level[45] = 70560000
$level[46] = 72000000
$level[47] = 73440000
$level[48] = 74880000
$level[49] = 76320000
$level[50] = 77760000
$level[51] = 79200000
$level[52] = 80640000
$level[53] = 82080000
$level[54] = 83520000
$level[55] = 84960000
$level[56] = 86400000
$level[57] = 87840000
$level[58] = 89280000
$level[59] = 90720000
$level[60] = 92160000
$level[61] = 95040000
$level[62] = 97920000
$level[63] = 100800000
$level[64] = 103680000
$level[65] = 106560000
$level[66] = 109440000
$level[67] = 112320000
$level[68] = 115200000
$level[69] = 118080000
$level[70] = 120960000
$level[71] = 126000000
$level[72] = 131040000
$level[73] = 136080000
$level[74] = 141120000
$level[75] = 146160000
$level[76] = 151200000
$level[77] = 156240000
$level[78] = 161280000
$level[79] = 166320000
$level[80] = 171360000
$level[81] = 177840000
$level[82] = 184320000
$level[83] = 190800000
$level[84] = 197280000
$level[85] = 203760000
$level[86] = 210240000
$level[87] = 216720000
$level[88] = 223200000
$level[89] = 229680000
$level[90] = 236160000
$level[91] = 244800000
$level[92] = 253440000
$level[93] = 262080000
$level[94] = 270720000
$level[95] = 279360000
$level[96] = 288000000
$level[97] = 296640000
$level[98] = 305280000
$level[99] = 313920000
$level[100] = 322560000
$level[101]=0
EndIf
If $Totalruns = 1 Then
$NiveauParagon = IterateActorAtribs($_MyGuid, $Atrib_Alt_Level)
$ExperienceNextLevel = IterateActorAtribs($_MyGuid, $Atrib_Alt_Experience_Next)
$Expencours = $level[$NiveauParagon + 1] - $ExperienceNextLevel
$Xp_Run = 0
$Xp_Total = 0
$Xp_Moy_Run = 0
$Xp_Moy_Hrs = 0
$time_Xp = 0
_format_time($time_Xp)
Else
;calcul de l'xp du run
If $NiveauParagon = IterateActorAtribs($_MyGuid, $Atrib_Alt_Level) Then; verification de level up (égalité => pas de level up
$Xp_Run = ($level[IterateActorAtribs($_MyGuid, $Atrib_Alt_Level) + 1] - IterateActorAtribs($_MyGuid, $Atrib_Alt_Experience_Next)) - $Expencours;experience run n - experience run n-1
EndIf
$Expencours = $level[IterateActorAtribs($_MyGuid, $Atrib_Alt_Level) + 1] - IterateActorAtribs($_MyGuid, $Atrib_Alt_Experience_Next)
If $NiveauParagon <> IterateActorAtribs($_MyGuid, $Atrib_Alt_Level) Then
$Xp_Run = $ExperienceNextLevel + $Expencours
EndIf
$Xp_Total = $Xp_Total + $Xp_Run
$Xp_Moy_Run = $Xp_Total / ($Totalruns - 1)
$Xp_Moy_Hrs = $Xp_Total * 3600000 / $dif_timer_stat
$NiveauParagon = IterateActorAtribs($_MyGuid, $Atrib_Alt_Level)
$ExperienceNextLevel = IterateActorAtribs($_MyGuid, $Atrib_Alt_Experience_Next)
;calcul temps avant prochain niveau
$Xp_Moy_Sec = $Xp_Total * 1000 / $dif_timer_stat
$time_Xp = Int($ExperienceNextLevel / $Xp_Moy_Sec) * 1000
_format_time($time_Xp)
$time_Xp = $dif_timer_stat_formater
EndIf
;########
_format_time($dif_timer_stat)
$timer_stat_total = $dif_timer_stat_formater
If $Totalruns = 1 Then
$timer_stat_run_moyen = 0
;Lv_stat=lv
;Xp_next_stat=Xp_next
;Xprun=0
;Xptotal=0
;Xpmoyen=0
Else
$dif_timer_stat_moyen = $dif_timer_stat / ($Totalruns - 1)
_format_time($dif_timer_stat_moyen)
$timer_stat_run_moyen = $dif_timer_stat_formater
EndIf
$DebugMessage = "Nombre de Runs : " & $Totalruns & @CRLF
$DebugMessage = $DebugMessage & "Nombre de Mort : " & $Death & @CRLF
$DebugMessage = $DebugMessage & "Nombre de resurrection: " & $Res_compt & @CRLF
$DebugMessage = $DebugMessage & "Nombre de Réparation/Vente : " & $RepairORsell & @CRLF
$DebugMessage = $DebugMessage & "Nombre d'objet stocké dans le Coffre : " & $ItemToStash & @CRLF
$DebugMessage = $DebugMessage & "Nombre d'objet Vendu : " & $ItemToSell & @CRLF
$DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
$DebugMessage = $DebugMessage & "GOLD Obtenu : " & $GOLDInthepocket & @CRLF
$DebugMessage = $DebugMessage & "GOLD Moyen par run : " & Ceiling($GOLDMOY) & @CRLF
$DebugMessage = $DebugMessage & "GOLD Moyen par heure : " & Ceiling($GOLDMOYbyH) & @CRLF
;stats XP
$DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
If ($Xp_Total < 1000000) Then ;afficher en "K"
$DebugMessage = $DebugMessage & "XP Obtenu : " & Int($Xp_Total / 1000) & " K" & @CRLF
EndIf
If ($Xp_Total > 999999) Then ;afficher en "M"
$DebugMessage = $DebugMessage & "XP Obtenu : " & Int($Xp_Total / 1000) / 1000 & " M" & @CRLF
EndIf
If ($Xp_Moy_Run < 1000000) Then ;afficher en "K"
$DebugMessage = $DebugMessage & "XP Moyen par run : " & Int($Xp_Moy_Run / 1000) & " K" & @CRLF
EndIf
If ($Xp_Moy_Run > 999999) Then ;afficher en "M"
$DebugMessage = $DebugMessage & "XP Moyen par run : " & Int($Xp_Moy_Run / 1000) / 1000 & " M" & @CRLF
EndIf
If ($Xp_Moy_Hrs < 1000000) Then ;afficher en "K"
$DebugMessage = $DebugMessage & "XP Moyen par heure : " & Int($Xp_Moy_Hrs / 1000) & " K" & @CRLF
EndIf
If ($Xp_Moy_Hrs > 999999) Then ;afficher en "M"
$DebugMessage = $DebugMessage & "XP Moyen par heure : " & Int($Xp_Moy_Hrs / 1000) / 1000 & " M" & @CRLF
EndIf
;$DebugMessage = $DebugMessage & "temps avant prochain niveau : " $ExperienceNextLevel/ & " M" & @CRLF
$DebugMessage = $DebugMessage & "temps avant prochain niveau : " & $time_Xp & @CRLF
$DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
;$DebugMessage = $DebugMessage & "XP Moyen par heure : " & $Xp_Moy_Hrs & @CRLF
;$DebugMessage = $DebugMessage & "XP avant prochain niveau : " & int($ExperienceNextLevel/1000)/1000 &" M" & @CRLF
;$DebugMessage = $DebugMessage & "niveau paragon actuel : " & $NiveauParagon & @CRLF
;$DebugMessage = $DebugMessage & "#################################"& @CRLF
;$DebugMessage = $DebugMessage & "test 1 : " & $level[$NiveauParagon+1] & @CRLF
;$DebugMessage = $DebugMessage & "exp en cours : " & int($Expencours/1000)/1000 &" M" &@CRLF
;$DebugMessage = $DebugMessage & "Xp_Run : " & int($Xp_Run/1000)/1000 &" M" &@CRLF
;$DebugMessage = $DebugMessage & "#################################"& @CRLF
;#########
$DebugMessage = $DebugMessage & "Durée Total : " & $timer_stat_total & @CRLF
$DebugMessage = $DebugMessage & "Durée moyenne d'un run: " & $timer_stat_run_moyen & @CRLF
$DebugMessage = $DebugMessage & "Nombre de déconnections : " & $disconnectcount & @CRLF
$DebugMessage = $DebugMessage & "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & @CRLF
$DebugMessage = $DebugMessage & "Statistique du Personnage : " & @CRLF
$DebugMessage = $DebugMessage & "Gold Find (Hors Paragon & Compagnon) : " & $GF & " %" & @CRLF
$DebugMessage = $DebugMessage & "Magic Find (Hors Paragon & Compagnon) : " & $MF & " %" & @CRLF
$DebugMessage = $DebugMessage & "PickUp Radius: " & $PR & @CRLF
$DebugMessage = $DebugMessage & "Movement Speed: " & $MS & " %" & @CRLF
$MESSAGE = $DebugMessage
ToolTip($MESSAGE, $DebugX, $DebugY)
$Totalruns = $Totalruns + 1 ;compte le nombre de run
EndFunc ;==>StatsDisplay
;;--------------------------------------------------------------------------------
;;############# END ########### of Stats by YoPens
;;--------------------------------------------------------------------------------
Func _format_time($time_milisecond)
Local $seconde_arrondi
Local $minute
Local $seconde
Local $heure
If ($time_milisecond < 60000) Then
$dif_timer_stat_formater = Round(($time_milisecond / 1000), 2) & " secondes"
ElseIf (($time_milisecond >= 60000) And ($time_milisecond < 3600000)) Then
$seconde_arrondi = Int($time_milisecond / 1000)
$minute = Int($seconde_arrondi / 60)
$seconde = Round((($time_milisecond / 1000) - $minute * 60), 0)
$dif_timer_stat_formater = $minute & " min " & $seconde & " sec"
Else
$seconde_arrondi = Int($time_milisecond / 1000)
$heure = Int($seconde_arrondi / 3600)
$minute = Int((($seconde_arrondi - $heure * 3600) / 60))
$seconde = Round((($time_milisecond / 1000) - $heure * 3600 - $minute * 60), 0)
$dif_timer_stat_formater = $heure & "h " & $minute & "m " & $seconde & "s"
EndIf
Return $dif_timer_stat_formater
EndFunc ;==>_format_time
;;--------------------------------------------------------------------------------
; Function: EmergencyStopCheck()
; Description: Check for dangerous behavior and stop bot if needed to prevent problems
;
; Note(s):
;;--------------------------------------------------------------------------------
Func EmergencyStopCheck()
If $Die2FastCount > 6 Then
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)
MsgBox(4096, "Arret d'urgence", "Nombre de mort : " & $Death)
Terminate()
EndIf
If $NeedRepairCount > 4 Then
WinSetOnTop("[CLASS:D3 Main Window Class]", "", 0)
MsgBox(4096, "Arret d'urgence", "Nombre de tentatives de repair a la suite : " & $NeedRepairCount)
Terminate()
EndIf
EndFunc ;==>EmergencyStopCheck
;;--------------------------------------------------------------------------------
; Function: enoughtPotions()
; Description: Read amount of pot in inv. Compare with Potionstock and set takepot to true of false.
;
;
;;--------------------------------------------------------------------------------
Func enoughtPotions()
Local $potinstock = Number(fastCheckuiValue('Root.NormalLayer.game_dialog_backgroundScreenPC.game_potion.text', 1, 875))
If $potinstock > $PotionStock Then
_log("I have more than " & $PotionStock & " potions. I will not take more until next check " & "("&$potinstock&")")
$takepot = False
Else
_log("I have less than " & $PotionStock & " potions. I will grab them until next check " & "pot:" & "("&$potinstock&")")
$takepot = True
Endif
EndFunc ;==>enoughtPotions
;;--------------------------------------------------------------------------------
; Function: Shrine()
; Description: Take Bonus shrine
;;--------------------------------------------------------------------------------
Func shrine($name, $offset, $guid)
Local $begin=timerinit()
While iterateactoratribs($guid, $Atrib_gizmo_state) <> 1 and _playerdead()= false
If getdistance(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float')) >= 8 Then
If timerdiff($begin)>4000 Then
_log('shrine is banned because time out')
Return false
ExitLoop
Else
$Coords = FromD3toScreenCoords(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
MouseMove($Coords[0], $Coords[1], 3)
Endif
Endif
Interact(_MemoryRead($offset + 0xB0, $d3, 'float'), _MemoryRead($offset + 0xB4, $d3, 'float'), _MemoryRead($offset + 0xB8, $d3, 'float'))
Wend
Endfunc ;shrine
;;--------------------------------------------------------------------------------
; Function: Die2Fast()
; Description: Cette fonction est appelée toute les 20 min.
;
; Note(s): Permet de detecter un nombre de mort a la suite trop important
;;--------------------------------------------------------------------------------
Func Die2Fast()
$Die2FastCount = 0
EndFunc ;==>Die2Fast
;;--------------------------------------------------------------------------------
; Functions: mesurestart() mesureend()
; Description: Mesurer...
;;--------------------------------------------------------------------------------
Func mesureStart()
Global $mesuredebug = TimerInit() ;;;;;;;;;;;;;;
$init = TimerInit()
EndFunc ;==>mesureStart
Func mesureEnd($nom)
Local $difmesuredebug = TimerDiff($mesuredebug) ;;;;;;;;;;;;;
ConsoleWrite("Mesure " & $nom & " : " & $difmesuredebug & @CRLF) ;FOR DEBUGGING;;;;;;;;;;;;
EndFunc ;==>mesureEnd
;;--------------------------------------------------------------------------------
; Functions: KJ Attrib STUFF
; Description: Read Atrib without dll
;;--------------------------------------------------------------------------------
Global $acd_data_start_ofs = 0
Global $attrib_data_start_ofs = 0
Global $acd_structure_size = 0x2D0 ; 1.0.5
Global $acd_ofs__guid = 0x000 ; 1.0.5
Global $acd_ofs__attrib_group_id = 0x120 ; 1.0.5
Global $attrib_link_ofs__next = 0x000 ; 1.0.5
Global $attrib_link_ofs__id = 0x004 ; 1.0.5
Global $attrib_link_ofs__value = 0x008 ; 1.0.5
Func kjInitMemPartialForAttributeReadingOnly($ofs_ObjectManager)
Local $ObjectManagerBase = _MemoryRead($ofs_ObjectManager, $d3, 'ptr')
Local $ObjectManagerStorageOfs = $ObjectManagerBase + 0x794
Local $ObjectManagerStorageDataOfs = _MemoryRead($ObjectManagerStorageOfs + 0x0A8, $d3, 'ptr')
Local $ObjectManagerStorageLocalOfs = _MemoryRead($ObjectManagerStorageOfs + 0x1B, $d3, 'ptr')
; ACD
Local $ObjManACDOffset = 0xD4
Local $a = _MemoryRead($ObjectManagerStorageOfs + $ObjManACDOffset, $d3, 'ptr')
Local $container_ofs = _MemoryRead($a, $d3, 'ptr')
Local $a = _MemoryRead($container_ofs + 0x148, $d3, 'ptr') ;container.List, double pointer
Global $acd_data_start_ofs = _MemoryRead($a, $d3, 'ptr') ;container.List
; actor attribs
Local $a = _MemoryRead($ObjectManagerStorageOfs + 0x0C8, $d3, 'ptr')
Local $container_ofs = _MemoryRead($a + 0x070, $d3, 'ptr')
Local $a = _MemoryRead($container_ofs + 0x148, $d3, 'ptr') ;container.List, double pointer
Global $attrib_data_start_ofs = _MemoryRead($a, $d3, 'ptr') ;container.List
Global $attrib_data_count_ofs = $container_ofs + 0x108 ;container.Count
EndFunc
Func kjGetActorAttributeFast($GUID, $Attrib, $req_mask, $default_value = -1)
_log($GUID)
$acd_index = BitAnd($GUID, 0xFFFF)
_log($acd_index)
$acd_ofs = $acd_data_start_ofs + $acd_index * $acd_structure_size
$aguid = _MemoryRead($acd_ofs + $acd_ofs__guid, $d3, 'int')
_log($aguid)
If ($aguid <> $GUID) Then Return $default_value
$attrib_group_id = _MemoryRead($acd_ofs + $acd_ofs__attrib_group_id, $d3, 'int')
$attrib_group_index = BitAnd($attrib_group_id, 0xFFFF)
$group_ofs = $attrib_data_start_ofs + $attrib_group_index * $ofs_ActorAtrib_StrucSize
$group_formula_ofs = _MemoryRead($group_ofs + 0x010, $d3, 'ptr')
$group_formula_map_data_ofs = _MemoryRead($group_formula_ofs + 0x008 + 0x000, $d3, 'ptr')
$mask = _MemoryRead($group_formula_ofs + 0x418, $d3, 'int')
$full_id = BitOr($Attrib[0], BitShift($req_mask, -12))
$idxmask = BitXOR($full_id, BitShift($full_id, 16))
$idx = BitAnd($mask, $idxmask)
$link_root_ofs = $group_formula_map_data_ofs + ($idx * 4)
$link_ofs = _MemoryRead($link_root_ofs, $d3, 'ptr')
$n = 0
While ($link_ofs <> 0x0)
$n += 1
$id = _MemoryRead($link_ofs + $attrib_link_ofs__id, $d3, 'int')
If ($id = $full_id) Then
$value = _MemoryRead($link_ofs + $attrib_link_ofs__value, $Attrib[1])
Return $value
EndIf
$link_ofs = _MemoryRead($link_ofs + $attrib_link_ofs__next, $d3, 'ptr')
If ($n > 10) Then ExitLoop ; inifinite loop safety
WEnd
Return $default_value
EndFunc
Func kjEnumActorAttributeFastSampleCode($GUID)
$acd_index = BitAnd($GUID, 0xFFFF)
_log($acd_index)
$acd_ofs = $acd_data_start_ofs + $acd_index * $acd_structure_size
$aguid = _MemoryRead($acd_ofs + $acd_ofs__guid, $d3, 'int')
_log($aguid)
If ($aguid <> $GUID) Then Return
$attrib_group_id = _MemoryRead($acd_ofs + $acd_ofs__attrib_group_id, $d3, 'int')
$attrib_group_index = BitAnd($attrib_group_id, 0xFFFF)
$group_ofs = $attrib_data_start_ofs + $attrib_group_index * $ofs_ActorAtrib_StrucSize
$group_formula_ofs = _MemoryRead($group_ofs + 0x010, $d3, 'ptr')
$group_formula_map_data_ofs = _MemoryRead($group_formula_ofs + 0x008 + 0x000, $d3, 'ptr') ; formula's map's data
For $link_index = 0 To 255
$link_root_ofs = $group_formula_map_data_ofs + ($link_index * 4)
$link_ofs = _MemoryRead($link_root_ofs, $d3, 'ptr')
$n = 0
While ($link_ofs <> 0x0)
$n += 1
$id = _MemoryRead($link_ofs + $attrib_link_ofs__id, $d3, 'ptr')
$maskedid = StringRight($id, 3)
$mask = StringMid($id, 3, 5)
$value = _MemoryRead($link_ofs + $attrib_link_ofs__value, $d3, 'int') ; or float
$link_ofs = _MemoryRead($link_ofs + $attrib_link_ofs__next, $d3, 'ptr')
If ($n > 10) Then ExitLoop ; inifinite loop safety
WEnd
Next
EndFunc
settings.ini
;;### Les lignes commançants par ;### ou ; sont des commentaires,
;;### elles sont la pour vous aider a la configuration, inutile de les modifier.
;;####################################################################
[Account info]
pass=
[Run info]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; Grab and monsters ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
monsterList=Beast_B|Goatman_M|Goatman_R|WitherMoth|Beast_A|Goblin|Scavenger|zombie|Corpulent|Skeleton|QuillDemon|FleshPitFlyer|Succubus|Scorpion|azmodanBodyguard|succubus|ThousandPounder|FallenGrunt|FallenChampion|FallenHound|FallenShaman|GoatMutant|demonFlyer_B|demonTrooper_|creepMob|Brickhouse_A|Brickhouse_B|Triune_|TriuneVesselActivated_|TriuneVessel|Triune_Summonable_|ConductorProxyMaster|goblin|sandWasp|TriuneCultist|SandShark|Lacuni
grabList=GoldMedium|GoldLarge|CraftingPlan_Smith_Drop
QualiteItem=9
rareList=Amulet_|Ring_|CraftingPlan_Smith_Drop
Potions=healthPotion_Mythic
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; BUFFS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
PreBuff1=false
ToucheBuff1=&
delaiBuff1=13000
PreBuff2=true
ToucheBuff2=é
delaiBuff2=12000
PreBuff3=false
ToucheBuff3="
delaiBuff3=12500
PreBuff4=true
ToucheBuff4='
delaiBuff4=6000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; Stat Energy ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Mettre le nombre d energie maximum que possede votre character.
MaximumHatred=125
MaximumDiscipline=25
MaximumSpirit=100
MaximumFury=100
MaximumArcane=128
MaximumMana=100
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; SURVIE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;### RightClickSpell ===> True (oui) / False (non) Click droit si la vie tombe en dessous de "LifeForEmergencyClick=xx"
;### LifeForEmergencyClick ==> % de vie avant de Cliquer
;### EmergencyClickDelay ==> Délai avant de re-cliquer en miliseconde (5000 = 5 secondes), 0 pour aucun délay
;### RightClickSpellEnergy ==> Nom de la source utilisé pour activer le sort
;### Vous avez le choix entre "discipline","hatred","spirit","arcane","mana", "Fury"
;### Si le sort n utilise aucune resource, ne mettez rien.
;### RightClickSpellEnergyNeeds ==> Le nombre de resource utilisé pour activer le sort.
RightClickSpell=True
LifeForRightClickSpell=100
RightClickSpellDelay=500
RightClickSpellEnergy=Arcane
RightClickSpellEnergyNeeds=18
Spell1Activated=True
LifeForSpell1=90
DefayForSpell1=7700
EnergySpell1=Arcane
EnergyNeedsSpell1=0
KeyForSpell1=&
Spell2Activated=false
LifeForSpell2=100
DefayForSpell2=240000
EnergySpell2=Arcane
EnergyNeedsSpell2=25
KeyForSpell2=é
Spell3Activated=true
LifeForSpell3=70
DefayForSpell3=13000
EnergySpell3=Arcane
EnergyNeedsSpell3=0
KeyForSpell3="
Spell4Activated=true
LifeForSpell4=100
DefayForSpell4=3500
EnergySpell4=Arcane
EnergyNeedsSpell4=25
KeyForSpell4='
;% de vie avant de prendre une potion
LifeForPotion=45
PotionStock= 80
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; Routines ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ResActivated=true
ResLife=2
repairafterxxgames=1
maxgamelength=1350000
attackRange=55
grabRange=110
attacktimeout=8000
grabtimeout=7500
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;; Advanced ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;### Devmode : false pour botter / true pour passer en mode dev (testing, position, monsterlist etc)
Devmode=false
lib/settings.au3
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Script Function:
Setup the settings file if it don't exist, overwise, setup de globals
#ce ----------------------------------------------------------------------------
Global $ResActivated= "false"
Global $ResLife="0"
Global $Res_compt=0
Global $nb_die_t = 0
Global $rdn_die_t = 0
Global $profilFile = "settings.ini"
Global $a_range = Round(Random(55, 60))
Global $g_range = Round(Random(100, 120))
Global $a_time = 9000
Global $g_time = 7500
Global $monsterList = "Beast_B|Goatman_M|Goatman_R|WitherMoth|Beast_A|Goblin|Scavenger|zombie|Corpulent|Skeleton|QuillDemon|FleshPitFlyer|Succubus|Scorpion|azmodanBodyguard|succubus|ThousandPounder|Fallen|GoatMutant|demonFlyer_B|creepMob|Brickhouse_A|Brickhouse_B|Triune_|TriuneVesselActivated_|TriuneVessel|Triune_Summonable_|ConductorProxyMaster|sandWasp|TriuneCultist|SandShark|Lacuni"
Global $grabList = "GoldCoin|GoldMedium|GoldSmall|GoldLarge|healthPotion_Mythic|Lore_Book_Flippy|Amethyst|Ruby|Topaz|Emerald|Tome|Book|Plan|BlacksmithsTome|"
Global $rareList = "Amulet_|Ring_"
Global $Potions = "healthPotion_Mythic"
Global $repairafterxxgames = Round(Random(6, 10))
Global $maxgamelength = 560000
Global $d3pass = ""
Global $PreBuff1 = ""
Global $ToucheBuff1 = ""
Global $delaiBuff1 = ""
Global $PreBuff2 = ""
Global $ToucheBuff2 = ""
Global $delaiBuff2 = ""
Global $PreBuff3 = ""
Global $ToucheBuff3 = ""
Global $delaiBuff3 = ""
Global $PreBuff4 = ""
Global $ToucheBuff4 = ""
Global $delaiBuff4 = ""
Global $QualityLevel = 9
Global $LifeForPotion = 50
Global $takepot = True
Global $PotionStock = 100
Global $MaximumHatred= 125
Global $MaximumDiscipline= 25
Global $MaximumSpirit= 100
Global $MaximumFury= 100
Global $MaximumArcane= 100
Global $MaximumMana= 100
Global $RightClickSpell= "false"
Global $LifeForRightClickSpell= ""
Global $RightClickSpellDelay= ""
Global $RightClickSpellEnergy = ""
Global $RightClickSpellEnergyNeeds = ""
Global $Spell1Activated= "false"
Global $LifeForSpell1= ""
Global $DefayForSpell1= ""
Global $EnergySpell1= ""
Global $EnergyNeedsSpell1= ""
Global $KeyForSpell1= ""
Global $Spell2Activated= "false"
Global $LifeForSpell2= ""
Global $DefayForSpell2= ""
Global $EnergySpell2= ""
Global $EnergyNeedsSpell2= ""
Global $KeyForSpell2= ""
Global $Spell3Activated= "false"
Global $LifeForSpell3= ""
Global $DefayForSpell3= ""
Global $EnergySpell3= ""
Global $EnergyNeedsSpell3= ""
Global $KeyForSpell3= ""
Global $Spell4Activated= "false"
Global $LifeForSpell4= ""
Global $DefayForSpell4= ""
Global $EnergySpell4= ""
Global $EnergyNeedsSpell4= ""
Global $KeyForSpell4= ""
;Global $Act = "3"
Global $Devmode = "true"
If Not FileExists($profilFile) Then
writeConfigs()
EndIf
loadConfigs()
Func writeConfigs($profilFile = "settings.ini", $creation = 0)
IniWrite($profilFile,"Run info","ResActivated", $ResActivated)
IniWrite($profilFile,"Run info","Reslife", $ResLife)
IniWrite($profilFile,"Account info","pass", 0)
IniWrite($profilFile,"Run info","monsterList", $monsterList)
IniWrite($profilFile,"Run info","grabList", $grabList)
IniWrite($profilFile,"Run info","QualiteItem", $QualityLevel)
IniWrite($profilFile,"Run info","rareList", $rareList)
IniWrite($profilFile,"Run info","attackRange", $a_range)
IniWrite($profilFile,"Run info","grabRange", $g_range)
IniWrite($profilFile,"Run info","attacktimeout", $a_time)
IniWrite($profilFile,"Run info","grabtimeout", $g_time)
IniWrite($profilFile,"Run info","repairafterxxgames", $repairafterxxgames)
IniWrite($profilFile,"Run info","maxgamelength", $maxgamelength)
IniWrite($profilFile,"Run info","Potions", $Potions)
IniWrite($profilFile,"Run info","PreBuff1", $PreBuff1)
IniWrite($profilFile,"Run info","ToucheBuff1", $ToucheBuff1)
IniWrite($profilFile,"Run info","delaiBuff1", $delaiBuff1)
IniWrite($profilFile,"Run info","PreBuff2", $PreBuff2)
IniWrite($profilFile,"Run info","ToucheBuff2", $ToucheBuff2)
IniWrite($profilFile,"Run info","delaiBuff2", $delaiBuff2)
IniWrite($profilFile,"Run info","PreBuff3", $PreBuff3)
IniWrite($profilFile,"Run info","ToucheBuff3", $ToucheBuff3)
IniWrite($profilFile,"Run info","delaiBuff3", $delaiBuff3)
IniWrite($profilFile,"Run info","PreBuff4", $PreBuff4)
IniWrite($profilFile,"Run info","ToucheBuff4", $ToucheBuff4)
IniWrite($profilFile,"Run info","delaiBuff4", $delaiBuff4)
IniWrite($profilFile,"Run info","LifeForPotion", $LifeForPotion)
IniWrite($profilFile,"Run info","PotionStock", $PotionStock)
IniWrite($profilFile,"Run info","MaximumHatred", $MaximumHatred)
IniWrite($profilFile,"Run info","MaximumDiscipline", $MaximumDiscipline)
IniWrite($profilFile,"Run info","MaximumSpirit", $MaximumSpirit)
IniWrite($profilFile,"Run info","MaximumFury", $MaximumFury)
IniWrite($profilFile,"Run info","MaximumArcane", $MaximumArcane)
IniWrite($profilFile,"Run info","MaximumMana", $MaximumMana)
IniWrite($profilFile,"Run info","RightClickSpell", $RightClickSpell)
IniWrite($profilFile,"Run info","LifeForRightClickSpell", $LifeForRightClickSpell)
IniWrite($profilFile,"Run info","RightClickSpellDelay", $RightClickSpellDelay)
IniWrite($profilFile,"Run info","RightClickSpellEnergy", $RightClickSpellEnergy)
IniWrite($profilFile,"Run info","RightClickSpellEnergyNeeds", $RightClickSpellEnergyNeeds)
IniWrite($profilFile,"Run info","Spell1Activated", $Spell1Activated)
IniWrite($profilFile,"Run info","LifeForSpell1", $LifeForSpell1)
IniWrite($profilFile,"Run info","DefayForSpell1", $DefayForSpell1)
IniWrite($profilFile,"Run info","EnergySpell1", $EnergySpell1)
IniWrite($profilFile,"Run info","EnergyNeedsSpell1", $EnergyNeedsSpell1)
IniWrite($profilFile,"Run info","Spell2Activated", $Spell2Activated)
IniWrite($profilFile,"Run info","LifeForSpell2", $LifeForSpell2)
IniWrite($profilFile,"Run info","DefayForSpell2", $DefayForSpell2)
IniWrite($profilFile,"Run info","EnergySpell2", $EnergySpell2)
IniWrite($profilFile,"Run info","EnergyNeedsSpell2", $EnergyNeedsSpell2)
IniWrite($profilFile,"Run info","Spell3Activated", $Spell3Activated)
IniWrite($profilFile,"Run info","LifeForSpell3", $LifeForSpell3)
IniWrite($profilFile,"Run info","DefayForSpell3", $DefayForSpell3)
IniWrite($profilFile,"Run info","EnergySpell3", $EnergySpell3)
IniWrite($profilFile,"Run info","EnergyNeedsSpell3", $EnergyNeedsSpell3)
IniWrite($profilFile,"Run info","Spell4Activated", $Spell4Activated)
IniWrite($profilFile,"Run info","LifeForSpell4", $LifeForSpell4)
IniWrite($profilFile,"Run info","DefayForSpell4", $DefayForSpell4)
IniWrite($profilFile,"Run info","EnergySpell4", $EnergySpell4)
IniWrite($profilFile,"Run info","EnergyNeedsSpell4", $EnergyNeedsSpell4)
IniWrite($profilFile,"Run info","KeyForSpell1", $KeyForSpell1)
IniWrite($profilFile,"Run info","KeyForSpell2", $KeyForSpell2)
IniWrite($profilFile,"Run info","KeyForSpell3", $KeyForSpell3)
IniWrite($profilFile,"Run info","KeyForSpell4", $KeyForSpell4)
;IniWrite($profilFile,"Run info","Act", $Act)
IniWrite($profilFile,"Run info","Devmode", $Devmode)
EndFunc
Func loadConfigs($profilFile = "settings.ini", $creation = 0)
;; windows informations
;$winName = IniRead($profilFile,"windows info","winName","Diablo III")
;$gamePath = IniRead($profilFile,"windows info","gameExecFullPath",0)
;; Account info
$d3pass = IniRead($profilFile, "Account info", "pass", 0)
;; Run info
$ResActivated = IniRead($profilFile,"Run info","ResActivated", $ResActivated)
$ResLife = IniRead($profilFile,"Run info","ResLife", $ResLife)
$monsterList = IniRead($profilFile, "Run info", "monsterList", $monsterList)
$grabList = IniRead($profilFile, "Run info", "grabList", $grabList)
$QualityLevel = IniRead($profilFile,"Run info","QualiteItem", $QualityLevel)
$rareList = IniRead($profilFile,"Run info","rareList", $rareList)
$a_range = IniRead($profilFile, "Run info", "attackRange", $a_range)
$g_range = IniRead($profilFile, "Run info", "grabRange", $g_range)
$a_time = IniRead($profilFile,"Run info","attacktimeout", $a_time)
$g_time = IniRead($profilFile,"Run info","grabtimeout", $g_time)
$repairafterxxgames = IniRead($profilFile, "Run info", "repairafterxxgames", $repairafterxxgames)
$maxgamelength = IniRead($profilFile, "Run info", "maxgamelength", $maxgamelength)
$Potions = IniRead($profilFile, "Run info", "Potions", $Potions)
$PreBuff1 = IniRead($profilFile, "Run info", "PreBuff1", $PreBuff1)
$ToucheBuff1 = IniRead($profilFile, "Run info", "ToucheBuff1", $ToucheBuff1)
$delaiBuff1 = IniRead($profilFile, "Run info", "delaiBuff1", $delaiBuff1)
$PreBuff2 = IniRead($profilFile, "Run info", "PreBuff2", $PreBuff2)
$ToucheBuff2 = IniRead($profilFile, "Run info", "ToucheBuff2", $ToucheBuff2)
$delaiBuff2 = IniRead($profilFile, "Run info", "delaiBuff2", $delaiBuff2)
$PreBuff3 = IniRead($profilFile, "Run info", "PreBuff3", $PreBuff3)
$ToucheBuff3 = IniRead($profilFile, "Run info", "ToucheBuff3", $ToucheBuff3)
$delaiBuff3 = IniRead($profilFile, "Run info", "delaiBuff3", $delaiBuff3)
$PreBuff4 = IniRead($profilFile, "Run info", "PreBuff4", $PreBuff4)
$ToucheBuff4 = IniRead($profilFile, "Run info", "ToucheBuff4", $ToucheBuff4)
$delaiBuff4 = IniRead($profilFile, "Run info", "delaiBuff4", $delaiBuff4)
$LifeForPotion = IniRead($profilFile,"Run info","LifeForPotion", $LifeForPotion)
$PotionStock = IniRead($profilFile, "Run info", "PotionStock", $PotionStock)
$RightClickSpell = IniRead($profilFile,"Run info","RightClickSpell", $RightClickSpell)
$LifeForRightClickSpell = IniRead($profilFile,"Run info","LifeForRightClickSpell", $LifeForRightClickSpell)
$RightClickSpellDelay = IniRead($profilFile,"Run info","RightClickSpellDelay", $RightClickSpellDelay)
$RightClickSpellEnergy = IniRead($profilFile,"Run info","RightClickSpellEnergy", $RightClickSpellEnergy)
$RightClickSpellEnergyNeeds = IniRead($profilFile,"Run info","RightClickSpellEnergyNeeds", $RightClickSpellEnergyNeeds)
$Spell1Activated = IniRead($profilFile,"Run info","Spell1Activated", $Spell1Activated)
$LifeForSpell1 = IniRead($profilFile,"Run info","LifeForSpell1", $LifeForSpell1)
$DefayForSpell1 = IniRead($profilFile,"Run info","DefayForSpell1", $DefayForSpell1)
$EnergySpell1 = IniRead($profilFile,"Run info","EnergySpell1", $EnergySpell1)
$EnergyNeedsSpell1 = IniRead($profilFile,"Run info","EnergyNeedsSpell1", $EnergyNeedsSpell1)
$Spell2Activated = IniRead($profilFile,"Run info","Spell2Activated", $Spell2Activated)
$LifeForSpell2 = IniRead($profilFile,"Run info","LifeForSpell2", $LifeForSpell2)
$DefayForSpell2 = IniRead($profilFile,"Run info","DefayForSpell2", $DefayForSpell2)
$EnergySpell2 = IniRead($profilFile,"Run info","EnergySpell2", $EnergySpell2)
$EnergyNeedsSpell2 = IniRead($profilFile,"Run info","EnergyNeedsSpell2", $EnergyNeedsSpell2)
$Spell3Activated = IniRead($profilFile,"Run info","Spell3Activated", $Spell3Activated)
$LifeForSpell3 = IniRead($profilFile,"Run info","LifeForSpell3", $LifeForSpell3)
$DefayForSpell3 = IniRead($profilFile,"Run info","DefayForSpell3", $DefayForSpell3)
$EnergySpell3 = IniRead($profilFile,"Run info","EnergySpell3", $EnergySpell3)
$EnergyNeedsSpell3 = IniRead($profilFile,"Run info","EnergyNeedsSpell3", $EnergyNeedsSpell3)
$Spell4Activated = IniRead($profilFile,"Run info","Spell4Activated", $Spell4Activated)
$LifeForSpell4 = IniRead($profilFile,"Run info","LifeForSpell4", $LifeForSpell4)
$DefayForSpell4 = IniRead($profilFile,"Run info","DefayForSpell4", $DefayForSpell4)
$EnergySpell4 = IniRead($profilFile,"Run info","EnergySpell4", $EnergySpell4)
$EnergyNeedsSpell4 = IniRead($profilFile,"Run info","EnergyNeedsSpell4", $EnergyNeedsSpell4)
$KeyForSpell1 = IniRead($profilFile,"Run info","KeyForSpell1", $KeyForSpell1)
$KeyForSpell2 = IniRead($profilFile,"Run info","KeyForSpell2", $KeyForSpell2)
$KeyForSpell3 = IniRead($profilFile,"Run info","KeyForSpell3", $KeyForSpell3)
$KeyForSpell4 = IniRead($profilFile,"Run info","KeyForSpell4", $KeyForSpell4)
$MaximumHatred = IniRead($profilFile,"Run info","MaximumHatred", $MaximumHatred)
$MaximumDiscipline = IniRead($profilFile,"Run info","MaximumDiscipline", $MaximumDiscipline)
$MaximumSpirit = IniRead($profilFile,"Run info","MaximumSpirit", $MaximumSpirit)
$MaximumFury = IniRead($profilFile,"Run info","MaximumFury", $MaximumFury)
$MaximumArcane = IniRead($profilFile,"Run info","MaximumArcane", $MaximumArcane)
$MaximumMana = IniRead($profilFile,"Run info","MaximumMana", $MaximumMana)
;$Act = IniRead($profilFile,"Run info","Act", $Act)
$Devmode = IniRead($profilFile,"Run info","Devmode", $Devmode)
If $RightClickSpellEnergy <> "" AND $RightClickSpellEnergy <> "discipline" AND $RightClickSpellEnergy <> "hatred" AND $RightClickSpellEnergy <> "spirit" AND $RightClickSpellEnergy <> "arcane" AND $RightClickSpellEnergy <> "mana" AND $RightClickSpellEnergy <> "fury" Then
MsgBox(0, "Erreur non de variable", "La variable '$RightClickSpellEnergy' initialisé dans le setting.ini est mal écrite")
Terminate()
EndIf
If $EnergySpell1 <> "" AND $EnergySpell1 <> "discipline" AND $EnergySpell1 <> "hatred" AND $EnergySpell1 <> "spirit" AND $EnergySpell1 <> "arcane" AND $EnergySpell1 <> "mana" AND $EnergySpell1 <> "fury" Then
MsgBox(0, "Erreur non de variable", "La variable '$EnergySpell1' initialisé dans le setting.ini est mal écrite")
Terminate()
EndIf
If $EnergySpell2 <> "" AND $EnergySpell2 <> "discipline" AND $EnergySpell2 <> "hatred" AND $EnergySpell2 <> "spirit" AND $EnergySpell2 <> "arcane" AND $EnergySpell2 <> "mana" AND $EnergySpell2 <> "fury" Then
MsgBox(0, "Erreur non de variable", "La variable '$EnergySpell2' initialisé dans le setting.ini est mal écrite")
Terminate()
EndIf
If $EnergySpell3 <> "" AND $EnergySpell3 <> "discipline" AND $EnergySpell3 <> "hatred" AND $EnergySpell3 <> "spirit" AND $EnergySpell3 <> "arcane" AND $EnergySpell3 <> "mana" AND $EnergySpell3 <> "fury" Then
MsgBox(0, "Erreur non de variable", "La variable '$EnergySpell3' initialisé dans le setting.ini est mal écrite")
Terminate()
EndIf
If $EnergySpell4 <> "" AND $EnergySpell4 <> "discipline" AND $EnergySpell4 <> "hatred" AND $EnergySpell4 <> "spirit" AND $EnergySpell4 <> "arcane" AND $EnergySpell4 <> "mana" AND $EnergySpell4 <> "fury" Then
MsgBox(0, "Erreur non de variable", "La variable '$EnergySpell4' initialisé dans le setting.ini est mal écrite")
Terminate()
EndIf
EndFunc ;==>loadConfigs
EDIT : Afin de faciliter la lisibilité j'ai mis en rouge les lignes de code remplacées dans chaque fichier (sauf le sequence puisque là si j'ai bien compris, il faut tout remplacer)
Merci d'avance
#79
kickbar
-
- Membre
-
- 539 messages
Devlopette
- Hobbies :Informatiques, jeux vidéo, botting !!!! ;D
Posté 07 December 2012 - 09:07
Je suis sur que c'est une erreur bête (oublie de variable en l'occurence) mais comme sa a froid je ne trouve pas l'erreur :/
avec les logs je devrais pouvoir t'aider
#80
Amonsaul
-
- Membres
-
- 10 messages
Newbie lvl 3
- Location :Montpellier
- Hobbies :Web, Jeux-video, Films
Posté 07 December 2012 - 12:08
En fait j'avais tout bien modifié, mais en bon noob que je suis, j'avais oublié de compiler le nouveau main en *.exe .... et je continuais inlassablement à lancer l'ancien main.exe en me demandant pourquoi ça ne marchait pas !!!
Erreur de débutant donc...
En tout cas merci de ta réponse
Je vais pouvoir enfin tester cette fonction, tout fonctionne apparemment très bien. A bientôt


Ce sujet est fermé



