Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   GUI Tool (https://forums.graalonline.com/forums/showthread.php?t=79168)

[email protected] 03-24-2008 07:02 PM

GUI Tool
 
1 Attachment(s)
What I've posted here today, is, well a "tool" I guess. Don't judge right off the bat though, I made this in mind that it would help Admins/Managers around the server while on player doing whatever. Please don't get an image of "BlooTool" or anything like that. You've all posted scripts here in mind of helping other servers, and I'd like to do the same. Except my concept is more focused on PR related issues, not so much of development.

Basically is a chat room with many features, and tools that
can help you as an Admin, Manager, or whatever in situations
you may come across on player. I've found this useful, and hope you do too.
(I'm sorta geeky and made it like an RC theme. ;p)

I came across this link (My inspiration I guess), and though I could actually make a tool that's more useful and such, rather than abusive looking.
http://forums.graalonline.com/forums...ght=admin+tool

Also, I didn't add features such as summon all, and stuff like that,
as I really see no point for that, as I've NEVER needed to summon the
whole server to a level at one place or w/e. If you really need crud like
that, script it on your own. :cool:

With that aside, I'd also just like to mention that my script may seem
a bit unorganized...well, it is. But as long as I script efficiently and the
fact that I'm not allowing you guys to edit much in this script anyways,
I didn't see a point in organizing so you can find stuff. But if organizing a script so a player can find things easier helps a script run smoother or less laggy in some way that I don't know of, please tell me, as I seriously wasn't aware. o.o

Also, criticism is welcome. But only if you've actually looked at the script atleast, or fired the weapon! So please tell me what you think of the GUI, and the scripting itself. I'm GP Chief on Unholy Nation, not a NAT, but I'd like to learn as much as possible! Thanks. :D

Also note, when using it on your server, you need to add yourself
to a certain string in the weapon before using it, or else it will destroy
itself onCreated. Just some security I've added with a ranking system for
the weapon. The string is on the clientside function onCreated part of the script.

Toxen 03-24-2008 07:05 PM

Actually ,I've watched this man script this overtime on Unholy Dev on Rc, it's actually a very nice put together GUI based tool.
Gratzz man.
Rep ++

xXziroXx 03-24-2008 07:14 PM

Far from everyone use Windows, or are generally unable to read .doc files. Please, make it a .txt file.

[email protected] 03-24-2008 07:19 PM

Ohh sure thing, sorry about that.
I'm on a MAc, and haven't posted an attachment before, I'll change that!

[email protected] 03-24-2008 08:11 PM

Okay, my parents allowed me to use their Windows (eww) PC.
So I uploaded it as a txt doc, you all should be good to go!
:)

Inverness 03-24-2008 08:18 PM

Quote:

Originally Posted by [email protected] (Post 1382062)
Okay, my parents allowed me to use their Windows (eww) PC.
So I uploaded it as a txt doc, you all should be good to go!
:)

What? Can't post a .txt file with a Mac? :p

Tolnaftate2004 03-24-2008 09:02 PM

Quote:

Originally Posted by xXziroXx (Post 1382054)
Far from everyone use Windows, or are generally unable to read .doc files. Please, make it a .txt file.

Who can't open a .doc file?
If you're on Windows without Word, MS Works will open it.
If you're on a Mac without Word, there's always NeoOffice.
If you're on a Unix system, you have OpenOffice.

@Inverness: They can, maybe he's never used TextEditor? I dunno x-x.

Chompy 03-24-2008 10:20 PM

Some things though:

All the lines aren't aligned the same, example:
PHP Code:

   if (temp.Online2 != true) {
   for (
plserverr.CrowRC) {
     
pl findPlayer(pl);
     
pl.triggerClient("weapon"this.name"errormsg"params[1], player.account);
    }
   } 

And instead of if (temp.Online2 != true) you should probably use if (!temp.Online2) :p

cbk1994 03-24-2008 10:21 PM

2 Attachment(s)
Quote:

Originally Posted by Inverness (Post 1382065)
What? Can't post a .txt file with a Mac? :p

What? Can't open .doc file with a Windows?

You can save as TXT, he didn't know how.

Attachments show how on the two programs that come with Mac for word processing.

[email protected] 03-25-2008 12:36 AM

Ahh, thanks for the info there Chompy. :]
I'll go ahead and change some of that. xd

And thanks cbkbud for the screen shots. I didn't know I could do that. xD Glad someone told me, so I don't have to keep swapping PCs all the time for things such as that, lol. :p

xXziroXx 03-25-2008 03:16 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1382073)
Who can't open a .doc file?
If you're on Windows without Word, MS Works will open it.
If you're on a Mac without Word, there's always NeoOffice.
If you're on a Unix system, you have OpenOffice.

I've used various friends and whatnot computer's that didn't have any program that can read a .doc file, both on Windows and Linux. And not like I would bother downloading/telling them to download it, just to read a file with an extention that I rarely come across. :)

cbk1994 03-25-2008 04:09 AM

1 Attachment(s)
Quote:

Originally Posted by xXziroXx (Post 1382218)
I've used various friends and whatnot computer's that didn't have any program that can read a .doc file, both on Windows and Linux. And not like I would bother downloading/telling them to download it, just to read a file with an extention that I rarely come across. :)

Fair enough, I originally read it as RTF and thought y'all were crazy ...

I should start posting some .pages documents.


EDIT:

Quote:

// While using this script you may only edit the contents 4 strings and nothing else, the 4 strings are:
Uhm, you posted it in the Code Gallery. We can change anything we want ...

[email protected] 03-25-2008 11:15 PM

Yeah, I pretty much know that cbkbud.
I added that in hopes players just wouldn't add other abusive commands or
whatnot. Because if the original script is down under my name, it wouldn't look
to good on me if other staff using it unfortunately used their additions in abusive ways and such.

Thanks for telling me anyways though. =o

Inverness 03-26-2008 12:17 AM

There is a hideimgs(start, end) function that you can use to hide multiple images instead of defining that ugly hideImgs() function in your script.
Quote:

Originally Posted by cbkbud (Post 1382102)
What? Can't open .doc file with a Windows?

Yes I can actually, thanks.

On Windows you can use Wordpad to view most .doc files, and Microsoft Word can view any that Wordpad can't view. .docx is viewed with Microsoft Word 2007 and above.

[email protected] 03-26-2008 01:12 AM

Eww, I wish I knew of that before. z.z
I was looking on the wiki for something along the lines such as that, since no
no NAT on UN knew of any such command, but I guess I never looked hard
enough because I didn't come across it.

Thanks, that'll actually come in hand for a few of my other scripts as well.

Inverness 03-26-2008 02:29 AM

Quote:

Originally Posted by [email protected] (Post 1382384)
no NAT on UN knew of any such command

That explains alot.

You also could have easily scripted it yourself instead of doing what you did.
PHP Code:

function hideimgs(startend) {
  for (
temp.start<= end++) {
    
hideimg(i);
  }



cbk1994 03-26-2008 02:40 AM

Quote:

Originally Posted by Inverness (Post 1382374)
On Windows you can use Wordpad to view most .doc files, and Microsoft Word can view any that Wordpad can't view. .docx is viewed with Microsoft Word 2007 and above.

I know, I easily use Windows twice as much as Mac ...

[email protected] 03-26-2008 03:08 AM

Oh wow, durr, I feel stupid. x_x
I did that for the boots and the player's outfit colors, but I just didn't think
of using that for the imgs.. z.z

Thanks for bringing that up. ;o

cbk1994 03-26-2008 03:17 AM

Quote:

Originally Posted by [email protected] (Post 1382412)
Oh wow, durr, I feel stupid. x_x
I did that for the boots and the player's outfit colors, but I just didn't think
of using that for the imgs.. z.z

Thanks for bringing that up. ;o

You're letting staff change player's appearance with a staff tool ... ?

I fail to see how that could ever be productive.

[email protected] 03-26-2008 03:48 AM

Actually I was referring to the view attributes part I've added, that shows
your current outfit that you're wearing.
Please check things before you make comments like that please. =x
I mean I wouldn't mind really, but I sorta took your post in a negative manner while you mentioned that about my script before checking it. o.o

And second, it actually does set player's outfits though anyways, though that's not what I was referring to in that post. But what I did, was set this up as a serverside action like this, to save up space...

"findplayer(params[1]).params[2] = params[3];"

So you can set basically all player.strings, and add/remove/edit clientr.strings for the player using that.

It's not like I set this up individually... z.z

"findplayer(params[1]).headimg = params[2];"

Now having a whole bunch of that ^ nonsense, is useless. ;p
But even though, I do say I've found myself in GP related situations where I've had to change someone's head, or shield, as an
uploader over looked an inappropriate image while uploading or w/e.

cbk1994 03-26-2008 04:19 AM

Quote:

Originally Posted by [email protected] (Post 1382418)
"findplayer(params[1]).params[2] = params[3];"

That is extremely insecure, I would never, ever use that.

For changing look, use RC. Staff tools should not be anything other than making things convenient, for example, jailing, summoning, adding weapons (where you have to deal with adding strings to the player, or editing a file, or whatever), etc. RC should be used for setting player strings such as client and clientr.

RC is there for a reason. Playerworld rules actually state that RC functions shouldn't be replaced with insecure scripted ones generally.

[email protected] 03-26-2008 04:32 AM

This tool is mainly to help Admins and Managers of the server get along
quick and easy on player as they come across situations.
Shame if an Admin or Manager finds a way to abuse it.

I just made this to help them go along easier on player, not having to log
onto RC or anything if they didn't want to at the moment. If you don't want
it on your server due to staff you cannot trust, then just don't have it? o.O
The staff that use this on the server I play on, surely aren't as low, and are
highly trust worthy.

So any thoughts like that never came across my mind, I just wanted to share
something I made, that responsible Admins can use for easy get around on player.

[Edit]: But I wasn't aware of this, that you've mentioned "Playerworld rules actually state that RC functions shouldn't be replaced with insecure scripted ones generally"
I'll get to finding a more secure method.

cbk1994 03-26-2008 05:10 AM

A few snippets from Playerworld Rules

NO NPC Should be abusive such as changing players names, changing players looks etc. IF you really need this then it should have security measures such as account and guild checking. And the NPC should log all users actions.

NPCs should not be used to substitute RC rights if they can’t be made secure.

It does mention that things like warpto, summon, etc are okay however, but something like a complete player control NPC is just not secure enough.

[email protected] 03-26-2008 05:16 AM

Well I'll get to adding logs asap then, as well as changing/removing some features too.
Thanks for showing me those, I wasn't aware. ;x

cbk1994 03-26-2008 05:19 AM

May also want to disable some things, maybe have an array like this:

PHP Code:

temp.notAllowed = { "rupees""hearts""fullhearts""kills""deaths""clientr.sacred" }; 

or whatever to protect certain scared variables that would most be targeted.

zokemon 03-26-2008 05:03 PM

Quote:

Originally Posted by Inverness (Post 1382402)
That explains alot.

:rolleyes:

Quote:

Originally Posted by [email protected] (Post 1382418)
But what I did, was set this up as a serverside action like this, to save up space...

"findplayer(params[1]).params[2] = params[3];"

LOL!
I'll remember that when Unholy Nation explodes one day from "hacking".

cbk1994 03-26-2008 10:36 PM

Quote:

Originally Posted by zokemon (Post 1382458)
LOL!
I'll remember that when Unholy Nation explodes one day from "hacking".

Exactly.

bscharff 03-29-2008 10:20 PM

Quote:

Originally Posted by [email protected] (Post 1382049)
Please don't get an image of "BlooTool" or anything like that.

Yay?!
I'm popular!
NOT

cbk1994 03-29-2008 10:57 PM

Quote:

Originally Posted by bscharff (Post 1383096)
Yay?!
I'm popular!
NOT

Sad when abusive ****ty scripts make you popular ...

Chompy 03-30-2008 02:27 AM

Hmm, I decided to read over your script, and came across a few things.

1.

PHP Code:

Line  984showPoly( -player.account, {player.xplayer.yplayer.3player.y}); 

Why do you use player.account?


2.

Line 1019: say2() -> use of #b, that's gs1


3.

Line 1089: "if (timeout && this.ison == true) {", should be
PHP Code:

function onTimeout() {
  if (
this.ison == true) { // or just 'if (this.ison) {'
    
...
  }



4.

Stuff like player.ap, player.fullhearts etc. should be set serverside.


5.

Line 12: Space between function and parenthesis


6.

Line 19: "if (temp.Online = true) {" -> use '=='
And it could even just be
PHP Code:

if (temp.Online) {
  ...



7.

On a server like Unholy Nation I don't think a global say2 command for staff is needed, nor any fun for a player, f.ex durring pk or sparring


8.

Line 339 & 339: Use of object.level should be object.level.name


9.

Line 688: 0.05 is the smallest a timeout can be clientside, 0.1 serverside



Just some stuff I found, hope this can improve your script :p!

Tolnaftate2004 03-30-2008 02:42 AM

Quote:

Originally Posted by Chompy (Post 1383138)
And it could even just be
PHP Code:

if (temp.Online) {
  ...



This is preferred. All if statements are evaluating the condition and then comparing it to 0, so bool == true/false is in fact doing twice as many checks: (bool == true/false) != false.

Inverness 03-30-2008 02:45 AM

if (flag) should be used instead of if (flag == true)
Edit: Though I find the if (flag == true) more readable, and it should be optimized by the compiler.

cbk1994 03-30-2008 03:22 AM

Quote:

Originally Posted by Inverness (Post 1383141)
Edit: Though I find the if (flag == true) more readable, and it should be optimized by the compiler.

Depends how you name variables.

I find it better to name booleans like 'bootsOn' versus 'boots'.

I think that
PHP Code:

if ( bootsOn 

is more readable then
PHP Code:

if ( bootsOn == true 



All times are GMT +2. The time now is 03:09 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.