Lineage 2 Tower Forum

Full Version: Auto run script after log in!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all!

I just started to use L2 tower, and I wrote a little script to register to TvT automatically. However I need to manually start the script after login. Is there any way, to auto start my script after i log in with a char?

Thanks in advance!
make such plugin:

    LUA Programming
function OnLogin(username)
ProcessCommand("/scriptstart YOURSCRIPT.lua");
end;


and replace YOURSCRIPT.lua to name of your script.
(07-04-2013 13:21 PM)kerberos464 Wrote: [ -> ]make such plugin:

    LUA Programming
function OnLogin(username)
ProcessCommand("/scriptstart YOURSCRIPT.lua");
end;


and replace YOURSCRIPT.lua to name of your script.

Thank you sir!

I tried, but it didn't worked for me.
What is that username param of the OnLogin() function?
Schould I write there my username? Please help!
Ex

    LUA Programming
function OnLogin(BadAssTank)
ProcessCommand("/scriptstart TankOnSpot.lua");
end;

Why not directly translate your script into a plugin?
(07-06-2013 16:45 PM)TheBl4ckPhoenix Wrote: [ -> ]Why not directly translate your script into a plugin?

How to do that? Big Grin
I mean my script is very short, it is only talking to TvT NPC, and registers for TvT, because there is no auto join TvT command on the server.

local npcName = "Catrina"

--function openTvTWindow(name)
target = GetTarget()
if ( target ~= nil ) then
if ( target:GetName() ~= npcName ) then
CancelTarget(true)
Sleep(500)
TargetNpc(npcName, 0)
Sleep(500)
end
else
TargetNpc(npcName, 0)
Sleep(500)
end

target = GetTarget()
if ( target ~= nil and target:GetName() == npcName ) then
Talk()
Sleep(500)
Click("", "Participate");
Sleep(500)
return true
end

How to make a plugin out of that? I mean I have a few characters I don't play with, and only bring them ingame for TvT, and it would be great if after login they would automatically register for tvt.
Please Help!

(07-06-2013 14:28 PM)Voli_Cerveja Wrote: [ -> ]Ex

    LUA Programming
function OnLogin(BadAssTank)
ProcessCommand("/scriptstart TankOnSpot.lua");
end;


This is not working Sad
My username and charactername is the same, and this still doesn't work.
So my question remains the same. How can I automatically run a script to talk with TvT NPC, after login?
THX for 0 help at all!
all the info is in my first post at this topic.
did i say that you have to change "username" to your own? no, i didn't.
you only need to replace YOURSCRIPT.lua to name of your script, that's all.
this is working fine for me for months.
(07-10-2013 11:18 AM)kerberos464 Wrote: [ -> ]all the info is in my first post at this topic.
did i say that you have to change "username" to your own? no, i didn't.
you only need to replace YOURSCRIPT.lua to name of your script, that's all.
this is working fine for me for months.

But it is not working for me!

What is username actually? Account name, or character name?
I tried it with both, and the script is not started!
How to start plugins automatically? Or why it doesn't start automatically? Can't figure it out.
just leave username as username, lol.
no need to change this.
this is like system variable, or something like that, i don't know how to explain better.
just leave it as it is.

btw, forum says you have very old l2tower version:
Version: 1.4.1.80

if this is really your l2tower's version, you have to upgrade.
Reference URL's