AutomaticCoding
New Member
- Joined
- Dec 20, 2011
- Messages
- 1,091
- Reaction score
- 1
Just playing around, not really coding anything worth while but I want to know how to call a function from a macro ingame.
So, say I type ingame:
/script Honorbuddy
luginName:RunFunction("reset");
then had in my script:
public void reset() {
bool enabled = true;
long startTime = new Java.util.Calendar().getInstance().getTimeInMillis();
settings = defaultSettings
}
How would I do this?
I'm thinking (can't test it, due to HB being down) that this would work:
/script var reset = true;
public void Pulse() {
if(Styx.StyxInstance.Lua.GetReturnVal<bool>("reset")) {
Styx.StyxInstance.Lua.DoString("var reeset = false");
reset();
}
}
But I'm not sure if that would work, would it?
So, say I type ingame:
/script Honorbuddy
then had in my script:
public void reset() {
bool enabled = true;
long startTime = new Java.util.Calendar().getInstance().getTimeInMillis();
settings = defaultSettings
}
How would I do this?
I'm thinking (can't test it, due to HB being down) that this would work:
/script var reset = true;
public void Pulse() {
if(Styx.StyxInstance.Lua.GetReturnVal<bool>("reset")) {
Styx.StyxInstance.Lua.DoString("var reeset = false");
reset();
}
}
But I'm not sure if that would work, would it?
Last edited:






