Author Topic: Eval  (Read 5273 times)

Eval
Use the console/Torquescript in the server chat using the $ symbol(default).
Comes with some shortened functions. A raycast is also fired whenever you use eval and some useful variables are added in so that you don't have to type as much. Eval is host-only but can be used by super admins also if you wish. There are a couple of things to block eval from being disabled with eval, but you probably still can if you really try. Any time eval is used the code is broadcasted to the whole server in the chat, as well as in the console.

Blockland Glass preferences included.

Never set $Eval::SuperAdmin to true unless you absolutely 100% trust your super admins!!!

You can use /evalHelp, $help(default), or check the description.txt file for help.
Included things:
$Eval::Symbol - Symbol(s) used to perform eval. Can be any length.
$Eval::SuperAdmin - Wether or not super admins can use eval.
fcbn(%name); - Find client by name shortened.
findPlayerByName(%name);- Find player by name.
fpbn(%name); - Find player by name shortened.
clearConsole(); - Adds whitespace to the bottom of the console.
colorTest(); - Shows you the \c# colors in the console.
%client, %cl, %me - Your client object.
%player, %pl - Your player object.
%hitObj - Object hit by a raycast fired when you use eval.
%hitData - Datablock of the thing your raycast hit.
%hitPos - Position where your raycast hit.
%hitDist - Distance from you to where your raycast hit.
%hitNorm - Normal where your raycast hit.
$Eval::Range - Range of raycast fired.
$Eval::Typemasks - Typemasks for raycast fired.

So for example, if I did $new AIPlayer(Bob) { datablock = PlayerStandardArmor; position = %hitPos; }; then a bot would be spawned at the spot I was looking.
If I did %cl.isSuperAdmin = false; %pl.kill(); then I would no longer be a super admin and I would die. Etc. The built-in variables are there to make your life easier, as are some of the included functions.

Download on Blockland Glass
« Last Edit: July 23, 2019, 10:23:00 AM by jes00 »

jes, you are a beautiful man

hey dosnt this already exist

hey dosnt this already exist
Yeah but I made it better by adding in some functions, a raycast, predefined variables, etc.

%hitnormal is actually really loving great

Hello I downloaded this addon and set $Eval::SuperAdmin to true and someone deleted my entire blockland folder how do I get it back

would be nice if you also had a %help variable that lets you echo/talk the list of available shortcut vars

been a while since one of these has been released publicly

would be nice if you also had a %help variable that lets you echo/talk the list of available shortcut vars
What do you mean? You can already use /evalHelp or $help to get the list in the chat.

Is it just me or has there been an add-on spree in recent months

I'm the host of the server and I'm running it on my BLID but the add-on doesn't recognise me as the host. I'm running this on a dedicated server and my role is Super Admin. Is this intended behaviour, or do I need to set SuperAdmin to true? Also, I'd like to know the purpose of `getNumKeyID()`.
« Last Edit: July 23, 2019, 07:32:46 AM by Keanu73 »

I'm the host of the server and I'm running it on my BLID but the add-on doesn't recognise me as the host. I'm running this on a dedicated server and my role is Super Admin. Is this intended behaviour, or do I need to set SuperAdmin to true? Also, I'd like to know the purpose of `getNumKeyID()`.
Updated it. Should be fixed. Just waiting for the update to be approved on Glass. getNumKeyID gets the BL ID of the host.


Updated it. Should be fixed. Just waiting for the update to be approved on Glass. getNumKeyID gets the BL ID of the host.

Alongside that, is there any sort of actual BL documentation? I think there was one on bldocs.nullable.se but that site's gone. I'd personally like to get into add-on scripting myself.

By the way, do you reckon you could add BL Glass pref support possibly? It's not the most needed thing but it'd be useful. Here's the reference if you want: https://forum.blockland.us/index.php?topic=320521.0

Alongside that, is there any sort of actual BL documentation?
Not really. Badspot isn't super into documenting all of the functions he added in.
I'd personally like to get into add-on scripting myself.
I think it's pretty fun. It's also cool to be able to make something you want from scratch. I started out just by looking at the code for add-ons and making small modifications. We're always happy to help in Modification Help or #coding-help on the Blockland Content Creator's Discord.
By the way, do you reckon you could add BL Glass pref support possibly? It's not the most needed thing but it'd be useful. Here's the reference if you want: https://forum.blockland.us/index.php?topic=320521.0
Sure. I was actually planning on doing it, but hadn't gotten to it yet. Whoops. I actually already did it and forgot about it.
« Last Edit: July 23, 2019, 10:07:02 AM by jes00 »