Jump to content

Release: Inject - Allows running dynamic scripts in running time


Zell

Recommended Posts


  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   260
  • Joined:  04/25/12
  • Last Seen:  

Inject - Allows running dynamic scripts in running time


This script commands allow you to "Inject" scripts inside other scripts.

But Zell, why I want this?

Well, you can use a script code from a SQL table! Imagine that now you can change scripts code blocks without reloading scripts direct from your database or you can even do like me where I'm building scripts from a API!

Sample Script:

 

prontera,150,150,5	Script	Inject Test	91,{

    .@test = rand(1, 100);

    mes "Let's test Inject";
    mes "I will declare variable .@test as " + .@test + ".";
    mes "My npc id is " + getnpcid(0), " ";
    mes "[Inject Code Start]", " ";

  	// This script text coud be loaded from a SQL table!
    Inject( "mes \"Running NPC is \" + getnpcid(0);        " +
            "mes \"Value of .@test is \" + .@test;         " +
            "next;                                         " +
            ".@test = rand(200, 500);                      " +
            "mes \"Now value of .@test will be \" + .@test;" +
            "close2;                                       " );

    mes "[Inject Code End]", " ";
    mes "Inject was ok and .@test is now " + .@test;
    close;
}

 


 

  • Upvote 4
  • Love 2
  • MVP 1
Link to comment
Share on other sites

  • 2 years later...

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   2
  • Joined:  01/26/13
  • Last Seen:  

Is this stable?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...