what i really like with Lua is lets say you want to access the calling players class (ima call it Client wich is GameClient class).
IN your LUA initialization you can add engine["Player"] = Client;
This tells lua to allow you access to the whole GameClient class.
Then later on in your script you can do something like...
Dialog("Welcome "..Player.Name.." What can i do for you?");
or
Player.Teleport(1002,400,400);
or
Player.Kill();
these are just examples To show you that with LUA you dont need to write your whole class over to a scriptable object.
what i really like with Lua is lets say you want to access the calling players class (ima call it Client wich is GameClient class).
IN your LUA initialization you can add engine["Player"] = Client;
This tells lua to allow you access to the whole GameClient class.
Then later on in your script you can do something like...
Dialog("Welcome "..Player.Name.." What can i do for you?");
or
Player.Teleport(1002,400,400);
or
Player.Kill();
these are just examples To show you that with LUA you dont need to write your whole class over to a scriptable object.
Regards
The same thing applies to (Iron)Python, you only have to register you object, like you did with your LUA script, and it has knowledge of the whole class.
Guess I'd go with what almost everyone else said, it's either Lua or Python. Reflection on the other hand can get quite messy, let alone that the performance *might* not be the best.
IMO though, you should make sure that reflection isn't slow in critical parts, and somehow measure relative performances of the possible routes that you may take (to my experience, not exactly the easiest task when you're dealing with a crapload of I/O). At the end of the day you should ultimately choose something that you're comfortable with and that doesn't impact the performance of the server.
when I first used Lua as NpcScripting language it was great , but there is a down part there!
as Ult. mentioned you can register a whole class to Lua and use it's fields/properties , but if lets say you registered a class called Hero, and that class has a property called Life.
Code:
uint Life{
get{
return this.life; //db arg
}
set{
this.life = value;
UpdateNotifier.Status(this.Id, Status.HP, value);// so it send a packet to update your health.
}
}
it sets the value , but it does not call the method UpdateStatus , not sure why, when I used IronPython it worked fine...
Guess I'd go with what almost everyone else said, it's either Lua or Python. Reflection on the other hand can get quite messy, let alone that the performance *might* not be the best.
IMO though, you should make sure that reflection isn't slow in critical parts, and somehow measure relative performances of the possible routes that you may take (to my experience, not exactly the easiest task when you're dealing with a crapload of I/O). At the end of the day you should ultimately choose something that you're comfortable with and that doesn't impact the performance of the server.
What I'm doing in my current source using reflection for C# scripting is loading the methods into a collection and simply calling upon that, but not loading them every time an action is required for it, but rather just having some form of update command which will update the collection with changes. Works pretty fine for me at least.
What I'm doing in my current source using reflection for C# scripting is loading the methods into a collection and simply calling upon that, but not loading them every time an action is required for it, but rather just having some form of update command which will update the collection with changes. Works pretty fine for me at least.
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)
The biggest bottleneck would be to place the head of the drive for each file. Else, hashing around 125 MB with MD5 is REALLY negligible.
Just do a quick hash check on the script files and update the appropriate ones every few minutes. (Would take what, 2 seconds to hash check 300 files? not done any tests myself, but I doubt it'd take long, depending on what hash you use)
Would that count empty files or files with actual content?
Also when the website is finished the scripts will be stored in an actual database and through the websites admin panel you'd edit the script. Everytime you saves a script it would notify the server about it and thus causing it to update.
[Python-Modul]EXP-Donator (kompatibel mit Python Loader) 11/23/2013 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 27 Replies Moin,
da man mich danach gefragt hat und ich sowieso mal ein Beispiel für die Benutzung meines Python Loaders veröffentlichen wollte, habe ich die Gelegenheit genutzt und euch eben einen EXP-Spendebot geschrieben.
Man kann ihn einfach mit dem oben verlinkten Python Module Loader laden und ihn mit F5 aktivieren/deaktivieren.
Sobald ihr mehr als 99 Erfahrungspunkte habt (man kann nur in 100er Schritten spenden), werden alle Erfahrungspunkte an eure Gilde gespendet.
Wer Lust hat und...
Python 02/18/2013 - General Coding - 0 Replies i make a program with python.
ciao--->Hi
Inserisci il primo numero---->1° number
Inserisci il secondo numero----->2°number
+ - * / options with button
thx :D