L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Thread Closed 
 
Thread Rating:
  • 2 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto run script after log in!
Author Message
joevokbazz Offline
Goblin Grave Robber
*

Posts: 10
Joined: Sep 2012
Reputation: 0
Version: 1.4.3.143
Post: #1
Auto run script after log in!

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!
07-04-2013 11:13 AM
Find all posts by this user
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #2
RE: Auto run script after log in!

make such plugin:

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


and replace YOURSCRIPT.lua to name of your script.

Everything is possible. The impossible just takes longer.
07-04-2013 13:21 PM
Visit this user's website Find all posts by this user
 Reputed by : PvPSuite(+2) , joevokbazz(+1) , vlados552(+2)
joevokbazz Offline
Goblin Grave Robber
*

Posts: 10
Joined: Sep 2012
Reputation: 0
Version: 1.4.3.143
Post: #3
RE: Auto run script after log in!

(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!
(This post was last modified: 07-06-2013 11:54 AM by joevokbazz.)
07-06-2013 11:23 AM
Find all posts by this user
Marv Offline
VIP Member
***

Posts: 276
Joined: Apr 2012
Reputation: 15
Version: 1.4.1.110
Post: #4
RE: Auto run script after log in!

Ex

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


Eu, eu ando de passo leve pra não acordar o dia
Sou da noite a companheira mais fiel qu'ela queria!
Big Grin
07-06-2013 14:28 PM
Find all posts by this user
TheBl4ckPhoenix Offline
(^.^)
****

Posts: 1,871
Joined: Mar 2012
Reputation: 601
Version: 1.4.3.143
Post: #5
RE: Auto run script after log in!

Why not directly translate your script into a plugin?
07-06-2013 16:45 PM
Find all posts by this user
 Reputed by : joevokbazz(+1)
joevokbazz Offline
Goblin Grave Robber
*

Posts: 10
Joined: Sep 2012
Reputation: 0
Version: 1.4.3.143
Post: #6
RE: Auto run script after log in!

(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?
(This post was last modified: 07-09-2013 16:15 PM by joevokbazz.)
07-09-2013 12:12 PM
Find all posts by this user
joevokbazz Offline
Goblin Grave Robber
*

Posts: 10
Joined: Sep 2012
Reputation: 0
Version: 1.4.3.143
Post: #7
RE: Auto run script after log in!

THX for 0 help at all!
07-10-2013 11:00 AM
Find all posts by this user
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #8
RE: Auto run script after log in!

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.

Everything is possible. The impossible just takes longer.
07-10-2013 11:18 AM
Visit this user's website Find all posts by this user
joevokbazz Offline
Goblin Grave Robber
*

Posts: 10
Joined: Sep 2012
Reputation: 0
Version: 1.4.3.143
Post: #9
RE: Auto run script after log in!

(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.
07-10-2013 14:02 PM
Find all posts by this user
kerberos464 Offline
Bug revealer

Posts: 1,538
Joined: Jun 2012
Reputation: 576
Version: 1.4.3.143
Post: #10
RE: Auto run script after log in!

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.

Everything is possible. The impossible just takes longer.
(This post was last modified: 07-10-2013 15:09 PM by kerberos464.)
07-10-2013 15:06 PM
Visit this user's website Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Auto Augment - Services / AIO NPC. 2pho3nix 11 18,385 07-27-2020 09:37 AM
Last Post: z3renity
  Help, with "Auto" De-level script JavaFan 3 3,341 11-12-2015 17:18 PM
Last Post: JavaFan
  [HELP] Auto Saved DC ! nikevers 0 2,116 07-28-2015 00:32 AM
Last Post: nikevers
  AUTO RES ACCEPT sonsfully 17 12,168 07-15-2015 19:59 PM
Last Post: Maveco
  Auto Accept Res Not working aywka 32 17,774 07-10-2015 08:16 AM
Last Post: TheQQmaster
Information pet auto attack alexanderkalm 0 2,796 07-09-2015 06:14 AM
Last Post: alexanderkalm
  WTB Auto accept mail scripts or plugins king200527 0 2,385 07-07-2015 11:39 AM
Last Post: king200527
  Not workl: Auto Resurrection On! . erickalisetc 9 6,994 05-27-2015 07:37 AM
Last Post: rORUMI
  Help Auto Buff Or Heal For Not In Party Verheiden 3 4,494 04-27-2015 16:58 PM
Last Post: Hebdzik
Information Auto Activate Soulshots odair2 2 4,015 03-04-2015 18:34 PM
Last Post: TheQQmaster



User(s) browsing this thread: 1 Guest(s)