Para's Script Library

01/25/2019 02:51 Paraly#2206
Quote:
Originally Posted by McSmoove View Post
Hi para,

I am trying to create myself a script for luna that just spam skill 1 and 2 forever, meanwhile checks if MAD miniboss comes and use the 5th skill. When last boss spowns, it uses skill 3 4 and 5 until it's dead.

But i think i got something wrong.

I was wondering how can i make the script to do something forever, like a while statement. And in this while statement, with an if, enter in another while statement. The script snippet that i made should work but i gotta write it in a better way.

Basicly i want to farm luna manually but i want the script to spam skill 1 and 2, while spamming i want it to check if mad miniboss spown and kill him and, when the last boss spowns, make the script spam skill 3 4 and 5 on the last boss target.

Thx for your help when u have time to fix this snippet, cheers

Code:
#DO=600000;
#EXECUTE=FarmLuna;
_UNTILMemRead=0xF557C4,BYTE,=1; ( while i have target? i dont know how to do something else, would be cool to say while im in the luna istance world ( I recall there should be a pointer with the map id in some memory register))

start_FarmLuna;

Delay=10;
Command=/skill Soul Skewer;
Delay=10;
Command=/skill Crushing Darkness;
Delay=10;
Command=/select MAD-74C;
_IFMemPtrRead=%TargetBase,%OffsetName,WCHAR[32],=MAD-74C;
_IFMemPtrRead=%TargetBase,%OffsetHP,DWORD,>0;
#IF=%TargetDistance,<15;
#IF=%Timer=415,60500;
Command=/skill Hellish Wave;
Delay=20;
Command=/skill Hellish Wave;
_IFMemPtrRead=%TargetBase,%OffsetName,WCHAR[32],=MAD-S;
#EXECUTE=FarmLastBoss;


end_FarmLuna;

start_FarmLastBoss;

#DO=600000;
Delay=10;
Command=/skill Terrifing Rupture;
Delay=10;
Command=/skill Hellish Stike;
Delay=10;
Command=/skill Hellish Wave;
_IFMemPtrRead=%TargetBase,%OffsetHP,DWORD,=0; (exit the script)
_UNTILMemRead=0xF557C4,BYTE,=1; ( while i have target? i dont know how to do something else, would be cool to say while im in the luna istance world ( I recall there should be a pointer with the map id in some memory register))

end_FarmLastBoss;
Loops are defined like this
Code:
#DO=300000;
some code
_UNTILMemPtrRead=%TargetBase,%OffsetHP,DWORD,=0;
This executes the code between the "#DO" and the "_UNTIL" till the condition of "_UNTIL" is true or till the timeout of 300000 milliseconds has been reached.

Now if you want 2 loops inside each other you have 2 methods you whether use #2DO and _2UNTIL like this
Code:
#DO=300000;
code of first loop
#2DO=20000;
code of second loop
_2UNTILMemPtrRead=%TargetBase,%OffsetName,WCHAR[32],=Kerubim;
code of first loop
_UNTILMemPtrRead=%TargetBase,%OffsetHP,DWORD,=0;
The second method would be that you call a function from within the first loop and inside this function you create the second loop, this would look like this
Code:
#DO=300000;
code of first loop
#EXECUTE=SecondLoop;
code of first loop
_UNTILMemPtrRead=%TargetBase,%OffsetHP,DWORD,=0;



start_SecondLoop;

#DO=20000;
code of second loop
_UNTILMemPtrRead=%TargetBase,%OffsetName,WCHAR[32],=Kerubim;

end_SecondLoop;

Since we can declare a timeout at the "#DO" command we can make an infinite loop like this
Code:
#DO=99999999999999;
some code
#UNTIL=1,=2;
the timeout is 99999999999999 milliseconds which is very very long and the condition of the "#UNTIL" command checks if "1" equals "2" which will never be true so it's basically an infinite loop


You can check the current map ID with this code
Code:
_MemReadVar=%AddrMap,DWORD,Map;
WaitForResponse=Current MapID: %Var[Map];
Once you got the MapID you can implement a checkup in your script for this certain ID, example:
Code:
_IFMemRead=%AddrMap,DWORD,=110010000;
WaitForResponse=Player is in Sanctum;
#ELSE
WaitForResponse=Player is not in Sanctum;
#ENDIF

so you learned that every "#DO" needs an "_UNTIL" to complete the loop, just like that it works with "IF" commands, every "IF" command needs an "#ENDIF" so vanillatool knows where to jump in case the "IF" was false

With this you should be able to fix/improve your script, but I can tell you the official luna script does exactly what you want, it spams key 1 and 2 for the normal mobs and waits till the mad mob appears to burst him away with the 5th skill, he does this until the final boss appears he then switches to skill 3, 4 and 5.
Anyways sure rewriting it by yourself will teach a lot of things.
01/25/2019 12:55 MiraFLo#2207
Quote:
Originally Posted by Paraly View Post
You can check your login status with
Code:
MemWrite=%AddrFreeMem0,%AddrCamX,DWORD;
_MemReadVar=%AddrFreeMem0,DWORD,CATempAddr;
_Calc[CATempAddr]=%Var[CATempAddr]+2200;

_IFMemRead=%Var[CATempAddr],WCHAR[32],=;
WaitForResponse=Not Logged in;
#ELSE
WaitForResponse=Logged in;
#ENDIF
about 1 hour later, the script hangs on checking
01/25/2019 12:57 Paraly#2208
Quote:
Originally Posted by MiraFLo View Post
about 1 hour later, the script hangs on checking
My snippet had no loops how could it get stuck there? :D

Show me how you implemented it, many get "stuck" at the Anti-Stuck detection, just disable it at startup
01/25/2019 13:08 MiraFLo#2209
I looped the script in the afk system


start_AntiAFK;

MemWrite=%AddrFreeMem1,0,BYTE;
#DO=%Var4;

MemWrite=%AddrFreeMem0,%AddrCamX,DWORD;
_MemReadVar=%AddrFreeMem0,DWORD,CATempAddr;
_Calc[CATempAddr]=%Var[CATempAddr]+2200;
_IFMemRead=%Var[CATempAddr],WCHAR[32],=;
WaitForResponse=Not Logged in;
#ELSE
#ENDIF

SendKey=0x76; <- F7
Delay=50000;
SendKey=0x49;
#IF=%Timer=1000,%Var4;
MemWrite=%AddrFreeMem1,1,BYTE;
#ENDIF
_UNTILMemRead=%AddrFreeMem1,BYTE,=1;

end_AntiAFK;
01/25/2019 13:11 Paraly#2210
Quote:
Originally Posted by MiraFLo View Post
I looped the script in the afk system


start_AntiAFK;

MemWrite=%AddrFreeMem1,0,BYTE;
#DO=%Var4;

MemWrite=%AddrFreeMem0,%AddrCamX,DWORD;
_MemReadVar=%AddrFreeMem0,DWORD,CATempAddr;
_Calc[CATempAddr]=%Var[CATempAddr]+2200;
_IFMemRead=%Var[CATempAddr],WCHAR[32],=;
WaitForResponse=Not Logged in;
#ELSE
#ENDIF

SendKey=0x76; <- F7
Delay=50000;
SendKey=0x49;
#IF=%Timer=1000,%Var4;
MemWrite=%AddrFreeMem1,1,BYTE;
#ENDIF
_UNTILMemRead=%AddrFreeMem1,BYTE,=1;

end_AntiAFK;
And what do you expect it should do?

It's completely pointless in there since he spams F7 and I to not get disconnected while at each iteration he checks if he still is logged in but this ckeckup does nothing than printing a message that he got disconnected so you can cut it away again
01/25/2019 13:27 MiraFLo#2211
why? when I have an Internet break, I have a window about "Not Logged in". how do i make an afk system with dс check?
01/25/2019 13:33 Paraly#2212
Quote:
Originally Posted by MiraFLo View Post
why? when I have an Internet break, I have a window about "Not Logged in". how do i make an afk system with dс check?
You mean with relogin, this obviously requires a few mouse clicks at the login screen and a few SendKey lines to enter your login name and password, this only works at EU

_____________


In case someone ever needs a live debug function

Code:
Code:
#IF=%FirstTime,;
_SetVar=DebugText,;
_SetVar=ShowDebug,1; Shows Debug / 0 Hides Debug
#ENDIF




_SetVar=DebugData,Some text; <-- Replace Some text with what ever you want to display
#EXECUTE=Debug; <-- call the Debug function afterwards to actually display what you declared above
Delay=5000;



start_Debug;

#IF=%Var[ShowDebug],=1;
_SetVar=DebugText,%Var[DebugText]/n%Var[DebugData];
_RegExp=%Var[DebugText],((?:(?!\/)(?!n).+?(?:\/n|\z)){1|||15}+\z),DebugText_Display;
_MemPtrReadVar=%PlayerBase,%OffsetName,WCHAR[32],PlayerName;
Display=%Var[DebugText_Display],0,0,Debug: %Var[PlayerName];
#ENDIF

end_Debug;
Example:
Code:
#IF=%FirstTime,;
_SetVar=DebugText,;
_SetVar=ShowDebug,1; Shows Debug / 0 Hides Debug
#ENDIF




_SetVar1=1;
#DO=60000;
_SetVar=DebugData,%Var1. Line;
#EXECUTE=Debug;
_Calc1=%Var1+1;
Delay=250;
#UNTIL=1,=2;




start_Debug;

#IF=%Var[ShowDebug],=1;
_SetVar=DebugText,%Var[DebugText]/n%Var[DebugData];
_RegExp=%Var[DebugText],((?:(?!\/)(?!n).+?(?:\/n|\z)){1|||15}+\z),DebugText_Display;
_MemPtrReadVar=%PlayerBase,%OffsetName,WCHAR[32],PlayerName;
Display=%Var[DebugText_Display],0,0,Debug: %Var[PlayerName];
#ENDIF

end_Debug;
01/25/2019 13:38 MiraFLo#2213
I need to stay afk and check that I received a disconnect. I have frequent dс. I don't need to log in after dc.
Such method works for me but the script in 1 hour hangs up for me
01/26/2019 18:43 mezorr#2214
static auto buff + heal script ? i mean chanter buff and heal any target radar but dont move
01/28/2019 19:59 Paraly#2215
I've added a new command called
Code:
_HTTPGetVar=[URL],[POST],[Variable],[RegEx];
With this command we can get information from the internet, it's only for advanced users since you need to know how RegEx patterns work, however here's a example code

This code gets the Item name of a certain ItemID in your current client language by using AionCodex.com
Code:
_SetVar=AionCodexID,140001113; <-- Item ID that should get translated
#EXECUTE=GetItemNameByID; <-- calls function to translate the ItemID to our client language
WaitForResponse=Item ID: %Var[AionCodexID]/nTranslated name: %Var[AionCodexReturn];



start_GetItemNameByID;

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/DEU/;
_SetVar=AionCodexLang,de;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/ENG/;
_SetVar=AionCodexLang,en;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/ENU/;
_SetVar=AionCodexLang,us;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/ITA/;
_SetVar=AionCodexLang,it;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/ESN/;
_SetVar=AionCodexLang,sp;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/FRA/;
_SetVar=AionCodexLang,fr;
#ENDIF

_IFMemRead=%AddrLangPack,CHAR[32],=L10N/PLK/;
_SetVar=AionCodexLang,pl;
#ENDIF


_HTTPGetVar=https://aioncodex.com/%Var[AionCodexLang]/item/%Var[AionCodexID]/,,AionCodexReturn,id="item_name"><b>(.*?)</b></span>;

end_GetItemNameByID;
02/05/2019 03:32 Dreamie123#2216
Hello how are you doing
I ask you a question, I had to format the pc for a problem I had and now the vanilla hack rework does not work for me and I have it paid for.
How can I make it work?
thank you
02/07/2019 18:24 MiraFLo#2217
I got a ban on all the accounts on which I used the Mirash script and one account received for soaring in the garden. don't use passage scripts.
02/07/2019 18:25 Paraly#2218
Quote:
Originally Posted by MiraFLo View Post
I got a ban on all the accounts on which I used the Mirash script and one account received for soaring in the garden. don't use passage scripts.
Yes, mirash is in the list of dangerous functions for a long time already
02/07/2019 18:36 MiraFLo#2219
where can I find out to a new buyer what can I use and where?
02/07/2019 18:38 Paraly#2220
Quote:
Originally Posted by MiraFLo View Post
where can I find out to a new buyer what can I use and where?
At the topic of this thread you see a spoiler called "Dangerous Scripts", just take a look at it, the same list is also available on discord