Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-10-2010, 11:09 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
F2 Cleaner

Ever used F2?
Feeling it's a bit too messy?

Theres a solution for it!

The F2 Cleaner will Clean all Tabs for you within a second!

Get it now!

Weapon:
PHP Code:
//#CLIENTSIDE
function F2LogWindow_Window.onShow() {
  if ( 
F2LogWindow_CheckBox.visible == false ) {
    
with (F2LogWindow_Window){
      new 
GuiCheckBoxCtrl("F2LogWindow_CheckBox") {
        
profile GuiBlueCheckBoxProfile;
        
hint "Clicking this checkbox will clear the F2 console window!";
        
575;
        
4;
        
width 100;
        
height 20;
        
text "";
      }
    }
  }
}
function 
F2LogWindow_CheckBox.onAction() {
  if (
F2LogWindow_CheckBox.checked) {
    (
"F2LogWindow_Tab").setselectedbyid(0);
    (
"F2LogWindow_Text0").text "Cleared!";
    for (
temp.1temp.6temp.i++) {
      (
"F2LogWindow_Text" i).text " ";
    }
    
sleep(1);
    
F2LogWindow_CheckBox.checked false;
     (
"F2LogWindow_Text0").text " ";
  }

Screenies:
|

Hope you will like it
dont forget to rep me if you do!
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you

Last edited by Deas_Voice; 06-11-2010 at 04:24 PM.. Reason: Edit1;added screenshots Edit2;added Hint to the code. Edit3;changed X value to non-calculating
Reply With Quote
  #2  
Old 06-10-2010, 11:21 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Any screenshots?
__________________
Reply With Quote
  #3  
Old 06-10-2010, 11:26 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
A check box seems a very weird way to do it. Why not use a button?

And what is this for?

PHP Code:
10^2.76
__________________
Reply With Quote
  #4  
Old 06-10-2010, 11:43 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by Chompy View Post
Any screenshots?
Sure, i'll add them in a sec!
Edit: Added, thu some File download sliped thru into the screeny when i just cleared it >:[
Quote:
Originally Posted by cbk1994 View Post
A check box seems a very weird way to do it. Why not use a button?
because it's tiny.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you

Last edited by Deas_Voice; 06-11-2010 at 04:25 PM.. Reason: lets forget this and move on.
Reply With Quote
  #5  
Old 06-11-2010, 12:30 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
just my way of doing 'x = 575.5;' .
Only that it's 575.43993733715693 and consumes some processing time to calculate.


Quote:
Originally Posted by Deas_Voice View Post
because it's tiny.
Make a tiny button!
__________________
Reply With Quote
  #6  
Old 06-11-2010, 01:21 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Use a button with an image.
Reply With Quote
  #7  
Old 06-11-2010, 01:27 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
snipping it down to this works just fine too:
PHP Code:
if(player.chat == "/clear logs"){
    (
"F2LogWindow_Tab").setselectedbyid(0);
    (
"F2LogWindow_Text0").text "Cleared!";
    for (
temp.1temp.6temp.i++) {
      (
"F2LogWindow_Text" i).text " ";
    }
  } 
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #8  
Old 06-11-2010, 02:55 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Chompy View Post
I didn't know the code gallery was the place to get your scripts grilled under the grill. You always get posts with "cool", "awesome code" or your code gets grilled with unconstructive comments > constructive comments.

I wished there rules was more strict for the code gallery. It's for releasing code to the public, not for other members to boast themselves by correcting them in a(n) unconstructive/non-informal way or try to make better code than the OP. It's not a challenge to have the best code.

I'm not saying that no one posts constructive comments either, it's just that there's a lack of these posts in the sea of unconstructive ones.
Chompy is one smart guy. Also it's kind of the scripting peoples nature here to outdo one another. Just like GFXers sometimes.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #9  
Old 06-11-2010, 08:06 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Deas_Voice View Post
just my way of doing 'x = 575.5;' .
That's a really bad idea, and I hope you edit your post and fix it. Teaching scripters to script in a way that requires them to pull out a calculator to read what's being written is counter-productive and defeats the purpose of the Code Gallery.

Quote:
Originally Posted by Chompy View Post
I didn't know the code gallery was the place to get your scripts grilled under the grill. You always get posts with "cool", "awesome code" or your code gets grilled with unconstructive comments > constructive comments.

I wished there rules was more strict for the code gallery. It's for releasing code to the public, not for other members to boast themselves by correcting them in a(n) unconstructive/non-informal way or try to make better code than the OP. It's not a challenge to have the best code.

I'm not saying that no one posts constructive comments either, it's just that there's a lack of these posts in the sea of unconstructive ones.
The Code Gallery is for helping new scripters by giving them model code examples. Granted, this script is also useful to developers, but the main purpose of any code gallery script is to help scripters learn.

The problems with the code in themselves do not make the script bad, but the way in which the OP jumped at myself and others for calling out the problems makes me think he has no interest in helping scripters and instead is of the mindset of "if it works, it works".

I don't see any non-constructive comments in this thread, either, until the point at which he accused everyone of whining about his script.

I consider you a better scripter than myself, Chompy, and I think you too would find scripts that have every number raised to a power to be very hard to read. You're not helping him or anyone reading this become a better scripter if you're not suggesting improvements to the way it is done now.
__________________

Last edited by cbk1994; 06-11-2010 at 04:11 PM..
Reply With Quote
  #10  
Old 06-11-2010, 03:51 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Chompy View Post
I didn't know the code gallery was the place to get your scripts grilled under the grill.
The code gallery is a place for people to post helpful scripts. By posting on the code gallery, you are always setting an example if someone likes your script. Therefore, it is very important for people to comment if something is being done incorrectly so that people who do want to use this script can change it to be more efficient/effective. We don't need to teach bad habits

I don't see people just grilling his script for no reason, they are providing real reasons why ____ is bad. For example, if you have a constant number, 575, you should just write 575 instead of calculating the value every single time. As Crow said, calculating 10^2.76 each time takes up more processing time than is necessary. Granted, it doesn't really make a big difference in this situation, it's still valuable knowledge to hold onto, and I think many scripters can benefit from this kind of advice.

Constructive criticism is an important part of learning how to be a better scripter. Deas, instead of becoming offended by these posts, you should embrace them and appreciate their helpful feedback, because it's not just blatant bashing.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #11  
Old 06-11-2010, 04:09 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Thanks for changing your original post, Deas_Voice. A shame that Sam deleted all of the posts in this thread, though, since some of them had very valid points.

Quote:
Originally Posted by Tigairius View Post
if you have a constant number, 575, you should just write 575 instead of calculating the value every single time. As Crow said, calculating 10^2.76 each time takes up more processing time than is necessary. Granted, it doesn't really make a big difference in this situation, it's still valuable knowledge to hold onto, and I think many scripters can benefit from this kind of advice.
The issue is much more that you need a calculator to read his code, not that takes a fraction of a fraction of a second longer to compute.
__________________
Reply With Quote
  #12  
Old 06-11-2010, 04:32 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
i suggest you all delete your posts about this minor issue, so we will have a clean thread about the code i've submitted here.
i've changed the original post to use non-calculation and added a Hint to the checkbox to tell the user what it does.

lets put this behind us, i'm sorry for thinking you all was out to bash me.
(although, some of you clearly was)
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #13  
Old 06-11-2010, 04:51 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
No reason to delete posts. Another scripter might stumble upon it and notice the discussion that's taken place, which could well benefit them.
__________________
Reply With Quote
  #14  
Old 06-11-2010, 04:53 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbk1994 View Post
No reason to delete posts. Another scripter might stumble upon it and notice the discussion that's taken place, which could well benefit them.
I deleted my posts since it actually had no relevance to this thread alone, but more to the scripting community and the code gallery itself. If anyone's interested in the content of the posts I wrote, just send a PM.
__________________
Reply With Quote
  #15  
Old 06-11-2010, 04:55 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Probably wouldn't hurt to provide a function that clears the windows. I.e:

PHP Code:
//#CLIENTSIDE

function clearF2Logs() {
  for (
temp.1temp.6temp.i++) {
    (
"F2LogWindow_Text" i).text "";
  }

Re-usability should be another thing taken into consideration in the Code Gallery.
__________________
Quote:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:18 PM.


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