Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #41  
Old 03-31-2007, 07:53 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Yeah, your old method of not styling at all and scripting like this:

PHP Code:
function onCreated(){
player.chat="Rapid's styling sucks major wang";
setTimer(1);
}

function 
onTimeOut(){
this.yourstylingoldstylingsucks;;
chat="You grouped everything together without any spacing";
echo(
"And it was very annoying to read");
setTimer(1);


Or something like that....



It was very annoying and barely legible.

Reply With Quote
  #42  
Old 03-31-2007, 08:07 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
Quote:
Originally Posted by Gambet View Post
Yeah, your old method of not styling at all and scripting like this:

PHP Code:
function onCreated(){
player.chat="Rapid's styling sucks major wang";
setTimer(1);
}

function 
onTimeOut(){
this.yourstylingoldstylingsucks;;
chat="You grouped everything together without any spacing";
echo(
"And it was very annoying to read");
setTimer(1);


Or something like that....



It was very annoying and barely legible.

Looks fine to me
Reply With Quote
  #43  
Old 03-31-2007, 08:32 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Bl0nkt View Post
Looks fine to me
You wonder why scripters hate looking at your scripts Hachi?

__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #44  
Old 03-31-2007, 08:51 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
I'd do this:
PHP Code:
public function Hurt(hurtDamageattackersAccounthurtGani)
  if (
this.clientr.hp && !this.clientr.dead && !level.nopk && !this.client.nopk)
  {
  
this.clientr.hp -= abs(temp.hurtDamage);  
  if (
temp.hurtGani
    
this.setAni("hurt""");
  
clientr.lastattacker temp.attackersAccount;
  if (
this.clientr.hp <= 0
    
this.doDeath(temp.attackersAccount);
  
this.showHp(7);
  }
public function 
doDeath(attackersAccount)
  {
  
this.clientr.dead true;
  
this.clientr.hp 0;
  
this.Kill(temp.attackersAccount); 
  } 
Reply With Quote
  #45  
Old 03-31-2007, 09:08 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Yes this has happened to me too *sneeze*TheFox*sneezes* I just used the Servers style command

/style Type Name

Like when Fox made a weapon I couldnt read I did

/Style weapon -FoxTest

it's not "my" style but it organizes the code.
__________________
Deep into the Darkness peering...
Reply With Quote
  #46  
Old 03-31-2007, 01:44 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by Angel_Light View Post
Yes this has happened to me too *sneeze*TheFox*sneezes* I just used the Servers style command

/style Type Name

Like when Fox made a weapon I couldnt read I did

/Style weapon -FoxTest

it's not "my" style but it organizes the code.
Simple yet effective
__________________
What signature? I see no signature?
Reply With Quote
  #47  
Old 03-31-2007, 02:02 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Chandler View Post
I'd do this:
PHP Code:
public function Hurt(hurtDamageattackersAccounthurtGani)
  if (
this.clientr.hp && !this.clientr.dead && !level.nopk && !this.client.nopk)
  {
  
this.clientr.hp -= abs(temp.hurtDamage);  
  if (
temp.hurtGani
    
this.setAni("hurt""");
  
clientr.lastattacker temp.attackersAccount;
  if (
this.clientr.hp <= 0
    
this.doDeath(temp.attackersAccount);
  
this.showHp(7);
  }
public function 
doDeath(attackersAccount)
  {
  
this.clientr.dead true;
  
this.clientr.hp 0;
  
this.Kill(temp.attackersAccount); 
  } 
Ugh, that makes my eyes bleed. Your brackets should be inline with the block, not with the contents. You've missed out a load of brackets anyway, and you've mixed all sorts of conditional checks which are totally unrelated to each other in one line. :/ Bleugh.
__________________
Skyld
Reply With Quote
  #48  
Old 03-31-2007, 02:12 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Skyld View Post
Ugh, that makes my eyes bleed. Your brackets should be inline with the block, not with the contents. You've missed out a load of brackets anyway, and you've mixed all sorts of conditional checks which are totally unrelated to each other in one line. :/ Bleugh.
I second that..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #49  
Old 03-31-2007, 02:24 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
Quote:
Originally Posted by Rapidwolve View Post
I recently have been practicing better organization and clean coding in my scripts, heres a snippet.

PHP Code:
public function Hurt(damageattackerhurtani){
  
temp.conditionsok = ((this.clientr.hp && this.clientr.dead == false && level.nopk == false && this.client.nopk == false) ? true false);
   if (
temp.conditionsok){
       if (
temp.damage => this.clientr.hp) {
        
this.clientr.hp 0;
        
this.Kill(temp.attacker); 
        
this.showHp(7);
        return;
       }
       if (
temp.hurtanithis.setani("hurt"null);
          
clientr.lastattacker temp.attacker;
          
this.clientr.hp -= abs(temp.damage);
          
this.showHp(7);
    }
    return;

Looks nice, but personally I prefer
PHP Code:
if (temp.hurtani == true
instead of
PHP Code:
if (temp.hurtani
and I'd recommend braces for everything anyway.

Hachi ... I'd be scared to see your scripting.
__________________
Reply With Quote
  #50  
Old 03-31-2007, 07:34 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Gambet View Post
Yeah, your old method of not styling at all and scripting like this:

PHP Code:
function onCreated(){
player.chat="Rapid's styling sucks major wang";
setTimer(1);
}

function 
onTimeOut(){
this.yourstylingoldstylingsucks;;
chat="You grouped everything together without any spacing";
echo(
"And it was very annoying to read");
setTimer(1);


Or something like that....



It was very annoying and barely legible.

I never styled like that x.x
Reply With Quote
  #51  
Old 03-31-2007, 07:37 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Skyld View Post
Ugh, that makes my eyes bleed. Your brackets should be inline with the block, not with the contents. You've missed out a load of brackets anyway, and you've mixed all sorts of conditional checks which are totally unrelated to each other in one line. :/ Bleugh.
*****.
Reply With Quote
  #52  
Old 03-31-2007, 08:26 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
Someone (Well, a couple) told me to change my styling so...

PHP Code:
public function Hurt(damageattackerhurtani) {
  
temp.conditionsok = ((this.clientr.hp && this.clientr.dead == false && level.nopk == false && this.client.nopk == false) ? true false);
  if (
temp.conditionsok) {

    if (
temp.damage => this.clientr.hp) {
      
this.clientr.hp 0;
      
this.Kill(temp.attacker); 
      
this.showHp(7);
      return 
NULL;
    }
    if (
temp.hurtani)
      
this.setani("hurt"NULL);

    
this.clientr.lastattacker temp.attacker;
    
this.clientr.hp -= abs(temp.damage);
    
this.showHp(7);
    return 
NULL;
  }

(Based of RW's script)
__________________
Reply With Quote
  #53  
Old 03-31-2007, 08:31 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
I don't care what people think of my styling it's makes scripting easier for me and allows ME to read it better/quicker. But when ever I do post a snippet I usually do use the /style.
__________________
Deep into the Darkness peering...
Reply With Quote
  #54  
Old 03-31-2007, 09:42 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
Quote:
Originally Posted by Chompy View Post
Someone (Well, a couple) told me to change my styling so...

PHP Code:
public function Hurt(damageattackerhurtani) {
  
temp.conditionsok = ((this.clientr.hp && this.clientr.dead == false && level.nopk == false && this.client.nopk == false) ? true false);
  if (
temp.conditionsok) {

    if (
temp.damage => this.clientr.hp) {
      
this.clientr.hp 0;
      
this.Kill(temp.attacker); 
      
this.showHp(7);
      return 
NULL;
    }
    if (
temp.hurtani)
      
this.setani("hurt"NULL);

    
this.clientr.lastattacker temp.attacker;
    
this.clientr.hp -= abs(temp.damage);
    
this.showHp(7);
    return 
NULL;
  }

(Based of RW's script)
I've never seen of return NULL. Any different from return false;?

--

There's more to scripting than you reading it. It needs to be legible for others too.
__________________
Reply With Quote
  #55  
Old 03-31-2007, 09:43 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 cbkbud View Post
I've never seen of return NULL. Any different from return false;?
return NULL; is just to clear out that it is not returning to a function nor returning a value.
__________________

Last edited by Chompy; 03-31-2007 at 09:57 PM..
Reply With Quote
  #56  
Old 03-31-2007, 09:56 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by cbkbud View Post
Looks nice, but personally I prefer
PHP Code:
if (temp.hurtani == true
instead of
PHP Code:
if (temp.hurtani
and I'd recommend braces for everything anyway.

Hachi ... I'd be scared to see your scripting.
What? if(something == true)? ::hits::
__________________
Reply With Quote
  #57  
Old 03-31-2007, 09:59 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
checking "if (var == true)" is redundant unless you're not sure on the type of the variable.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #58  
Old 04-01-2007, 12:58 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 JkWhoSaysNi View Post
checking "if (var == true)" is redundant unless you're not sure on the type of the variable.
Works fine ... to me it seems simpler.

if ( var == 1 )

better?
__________________
Reply With Quote
  #59  
Old 04-01-2007, 01:00 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
if (var) is simpler and more efficient.

when you do if (var == true) the interpreter is basically doing 2 checks.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #60  
Old 04-01-2007, 03:14 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
I see. I'll try to get used to that, though I suppose it doesn't matter that much now that I see it
__________________
Reply With Quote
  #61  
Old 04-06-2007, 10:38 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Skyld View Post
Ugh, that makes my eyes bleed. Your brackets should be inline with the block, not with the contents. You've missed out a load of brackets anyway, and you've mixed all sorts of conditional checks which are totally unrelated to each other in one line. :/ Bleugh.
I thought that was directed to me x.x
Reply With Quote
  #62  
Old 04-06-2007, 10:40 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 Rapidwolve View Post
I thought that was directed to me x.x
Thread revival xD
__________________
Reply With Quote
  #63  
Old 04-07-2007, 03:55 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Chompy View Post
return NULL; is just to clear out that it is not returning to a function nor returning a value.
Null IS a value, zero actually. You could just do return; anyways.

And I think Stefan should make the compiler optimize if (var == true) since that looks nicer than if (var) which makes me think of the horrors of GS1.
__________________
Reply With Quote
  #64  
Old 04-07-2007, 04:13 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Except Gscipt isn't compiled it's interpreted. If it were compiled then the compiler could optimise the statement (by turning it into if (var) ) but since it's interpreted I don't think theres any way to do it.

Anyway, the difference in speed is negligible. Just use if (var == true) if it makes it easier to read.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #65  
Old 04-07-2007, 04:17 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Everyone has their own style of coding, and they can read it. It doesn't matter if other people can't. I style similar to Skyld's styling, mainly because I find his scripts readable and he kinda pushed me to it :P
__________________
What signature? I see no signature?
Reply With Quote
  #66  
Old 04-07-2007, 04:35 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
GScript is not interpreted, its Compiled when you save the script. Thats how scripts are sent to the client Pre-Compiled like Stefan said. Unless Stefan has a different definition of Compiled.
__________________
Reply With Quote
  #67  
Old 04-07-2007, 05:49 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
I think they are optimised a bit and compiled into byte code.
Reply With Quote
  #68  
Old 04-07-2007, 02:14 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Its compiled into byte code, because they're all stored on your computer if you look closely enough.

Every time you add yourself a weapon, that compiled code goes directly into your computer, probably to lessen the load on the server.
__________________
What signature? I see no signature?
Reply With Quote
  #69  
Old 04-07-2007, 04:32 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
if (var) always reminded me of GS1 ... I still have nightmares about that.
__________________
Reply With Quote
  #70  
Old 04-07-2007, 09:27 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
if (playerchats) {
  
tokenize #c;
  
if (strequals(#t(0),kill:)) {
    
with (getplayer(#t(1))) {
      
playerhearts 0;
    }
  }

__________________
Reply With Quote
  #71  
Old 04-07-2007, 10:09 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Inverness View Post
GScript is not interpreted, its Compiled when you save the script. Thats how scripts are sent to the client Pre-Compiled like Stefan said. Unless Stefan has a different definition of Compiled.
I stand corrected. I always thought it was just interpreted.

The compiler could potentially optimise the code then.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #72  
Old 04-07-2007, 10:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by JkWhoSaysNi View Post
I stand corrected. I always thought it was just interpreted.

The compiler could potentially optimise the code then.
Scripts are folded when they are compiled so that they are more efficient.
__________________
Skyld
Reply With Quote
  #73  
Old 04-08-2007, 04:42 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
I would find it annoying if I wrote

PHP Code:
if ( var == 
and it changed it to
PHP Code:
if ( var == true 
__________________
Reply With Quote
  #74  
Old 04-08-2007, 04:48 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Usually the ammount of styling and the importance of a scripter's styling to himself usually reflects his skill with Graal coding.

Pretty hard to do complex scripts if you have horrible spacing
__________________
Do it with a DON!
Reply With Quote
  #75  
Old 04-08-2007, 05:02 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by zokemon View Post
Usually the ammount of styling and the importance of a scripter's styling to himself usually reflects his skill with Graal coding.

Pretty hard to do complex scripts if you have horrible spacing
Irrelevant if your typing speed is excellent.
__________________
Reply With Quote
  #76  
Old 04-08-2007, 07:58 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
I, too, think that example A looks better then example B.

A: if (var == true) { .... }
B: if (var) { .... }
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #77  
Old 04-08-2007, 09:36 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by xXziroXx View Post
I, too, think that example A looks better then example B.

A: if (var == true) { .... }
B: if (var) { .... }
Thats how I had it on my script first, I forgot why I changed it
Reply With Quote
  #78  
Old 04-10-2007, 04:29 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 xXziroXx View Post
I, too, think that example A looks better then example B.

A: if (var == true) { .... }
B: if (var) { .... }
C:
PHP Code:
if ( var == true )
{
    ...

C seems better than both
__________________
Reply With Quote
  #79  
Old 04-10-2007, 01:23 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by cbkbud View Post
C:
PHP Code:
if ( var == true )
{
    ...

C seems better than both
No way! I only make new lines for brackets on functions. And I just dont like that way of spacing
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #80  
Old 04-10-2007, 04:07 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Me either. The spaces inside the ( brackets offend me too

Heres how I do it:

PHP Code:
if (var) {
       ...

i guess if (var) has more meaning if you name your boolean variables as verbs as I tend to do e.g. if (finished)
__________________

Coming soon (Hopefully:P)
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 12:32 AM.


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