Though, my setup is probably not the same as others. This version of SS is for Minecraft 1.6.2. Please test, find bugs and post em here. I believe this is a stable build, but its still marked as Unofficial.
Talking to sadimusi if I should create a new topic or stick here.
I think for the last few updates iBotPeaches is the star of the show. He's the one behind much of the updates such as updating the protocols. My skills in Java are pretty shoddy (I mostly program in C, or the SimpleServer scripting language :3) so much of my work is just on trying to add a bit more oomph in the scripting system.
Currently doing some more testing on SimpleServer. So far, I haven't found out why player join messages don't get filtered properly when running Bukkit, and any forwarded chat is not filtered out if the forwardChat setting is set to "true". That means that public and private chat shows up in chat for everyone, and public chat shows up twice, one with SS' formatting and the other with the normal Minecraft formatting.
Currently doing some more testing on SimpleServer. So far, I haven't found out why player join messages don't get filtered properly when running Bukkit, and any forwarded chat is not filtered out if the forwardChat setting is set to "true". That means that public and private chat shows up in chat for everyone, and public chat shows up twice, one with SS' formatting and the other with the normal Minecraft formatting.
Open the spoiler section to view the screenshots.
I have not been having any issues with the chat. Ive been running the latest bukkit and SS builds.
I have not been having any issues with the chat. Ive been running the latest bukkit and SS builds.
Is your chat being forwarded to Bukkit itself? (ie. this line in config.xml where the chat forwarding setting is true)
<property name="forwardChat">true</property>
and chat messages show up in console as something like:
2013-07-10 20:27:00 [INFO] <ginbot86> Test chat message.
rather than:
ºe<ginbot86>ºfTest chat message.
Chat itself when shown by SS doesn't have any problems (like what is shown in your screenshots) but the issue that seems to pop up is when the chat is being sent through to the core Minecraft server.
Hey Gin, quick question about events in SS.... What is the most effective method for detecting whether or not a player is online, and when that player logs off? I am writing some event code that needs to be "aware" if the player quits / disconnects during it, and if possible whether or not it was intentional (quit) or not (service interrupt)?
Hey Gin, quick question about events in SS.... What is the most effective method for detecting whether or not a player is online, and when that player logs off? I am writing some event code that needs to be "aware" if the player quits / disconnects during it, and if possible whether or not it was intentional (quit) or not (service interrupt)?
I don't think there's any code that detects when a player logs off at the moment. I do like the idea of detecting whether a player logs out intentionally or due to some other error.
Would you mind posting some of the script code so I can see what's up with it?
Sure but i think i narrowed down what is happening anyway... worked "around" it.
With local variables I have always declared them up front (old coding habit), if a global variable (aka event) has a value of "", it is actually truncating the "value" field from the config.xml If when i reset a value I reset it to "null" (thereby keeping something in it) and check for that instead of "", i have no problems...
Will try and attach a screenshot...
that reminds me, is there an "isnull" postfixexp ?
Sure but i think i narrowed down what is happening anyway... worked "around" it.
With local variables I have always declared them up front (old coding habit), if a global variable (aka event) has a value of "", it is actually truncating the "value" field from the config.xml If when i reset a value I reset it to "null" (thereby keeping something in it) and check for that instead of "", i have no problems...
Will try and attach a screenshot...
that reminds me, is there an "isnull" postfixexp ?
There isn't a "isnull" postfix for scripts. However, does this sort of code work for you?
if $variable null eq
print "Variable is null!"
else
print "Variable is not null!"
endif
The line "if <variable> null eq" is what I use to check for null variables; it should work for your code as well.
Ok just for a clear explanation I created some events and commands specific for testing...
Given the following:
<event name="aaTestCmd">
if $aaTest_global null eq
say #PLAYER "Var is Null!"
else
say #PLAYER "Var is:" $aaTest_global ..
endif
</event>
if the variable is
<event name="aaTest_global" value="TextHere"/>
then the code executes as expected,
however, if it is
<event name="aaTest_global"/>
then the following error occurs at the console
Error at L1@aaTestCmd: if $aaTest_global null eq
Expression returns no value! Returning null.
Exception in thread "Thread-36" java.lang.NullPointerException
at simpleserver.events.PostfixEvaluator.toBool(Unknown Source)
at simpleserver.events.PostfixEvaluator.evaluateCondition(Unknown Source)
at simpleserver.events.RunningEvent.condition(Unknown Source)
at simpleserver.events.RunningEvent.run(Unknown Source)
If you change the value to null from within the game and run it, it works as expected... I exited and checked the config.xml just to see and it was set to
<event name="aaTest_global" value="null"/>
so it seems the problem only occurs when it is a "virgin" variable...
Just taking another look at the code, there is an "isempty" postfix. Could you see if it does what you'd like?
No it seems that any expression that refers to a "virgin" variable returns that error.
Also is there a "select case" type of command?
ie
select #variable
case 1
statement 1
statement 2
statement 3
case 2
statement 1
statement 2
statement 3
case "Any value to be compared to the above variable"
statement 1
statement 2
statement 3
else
statement 1
statement 2
statement 3
endselect
Where each "value" or "expression" is compared to #variable and just the statements for the matching are executed, if none match then the "else" statements are... (assuming there is an "else")
No it seems that any expression that refers to a "virgin" variable returns that error.
Also is there a "select case" type of command?
ie
select #variable
case 1
statement 1
statement 2
statement 3
case 2
statement 1
statement 2
statement 3
case "Any value to be compared to the above variable"
statement 1
statement 2
statement 3
else
statement 1
statement 2
statement 3
endselect
Where each "value" or "expression" is compared to #variable and just the statements for the matching are executed, if none match then the "else" statements are... (assuming there is an "else")
There isn't a "case select" command... yet. I've been working on it before but have been too busy recently. Using cascading if-else-endif commands gets confusing after about 3 levels in.
Though, my setup is probably not the same as others. This version of SS is for Minecraft 1.6.2. Please test, find bugs and post em here. I believe this is a stable build, but its still marked as Unofficial.
Talking to sadimusi if I should create a new topic or stick here.
Enjoy the the new build.
Okay. But seriously... thanks to you and anyone else involved in keeping this wrapper updated.
I second that with a HUGE emphasis on the Thanks part!!!!
Open the spoiler section to view the screenshots.
I have not been having any issues with the chat. Ive been running the latest bukkit and SS builds.
Is your chat being forwarded to Bukkit itself? (ie. this line in config.xml where the chat forwarding setting is true)
and chat messages show up in console as something like:
rather than:
Chat itself when shown by SS doesn't have any problems (like what is shown in your screenshots) but the issue that seems to pop up is when the chat is being sent through to the core Minecraft server.
I don't think there's any code that detects when a player logs off at the moment. I do like the idea of detecting whether a player logs out intentionally or due to some other error.
I am getting an "Invalid expression" error on things that are EXACTLY the same syntax as other event codes which seem to work...
The only difference here is that I am (for the first time) incorporating global variables... are there some issues there?
Would you mind posting some of the script code so I can see what's up with it?
Sure but i think i narrowed down what is happening anyway... worked "around" it.
With local variables I have always declared them up front (old coding habit), if a global variable (aka event) has a value of "", it is actually truncating the "value" field from the config.xml If when i reset a value I reset it to "null" (thereby keeping something in it) and check for that instead of "", i have no problems...
Will try and attach a screenshot...
that reminds me, is there an "isnull" postfixexp ?
There isn't a "isnull" postfix for scripts. However, does this sort of code work for you?
The line "if <variable> null eq" is what I use to check for null variables; it should work for your code as well.
Given the following:
if the variable is
then the code executes as expected,
however, if it is
then the following error occurs at the console
Hope that helps...
If you change the value to null from within the game and run it, it works as expected... I exited and checked the config.xml just to see and it was set to
so it seems the problem only occurs when it is a "virgin" variable...
No it seems that any expression that refers to a "virgin" variable returns that error.
Also is there a "select case" type of command?
ie
Where each "value" or "expression" is compared to #variable and just the statements for the matching are executed, if none match then the "else" statements are... (assuming there is an "else")
There isn't a "case select" command... yet. I've been working on it before but have been too busy recently. Using cascading if-else-endif commands gets confusing after about 3 levels in.