Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Scripting: Line Counter (https://forums.graalonline.com/forums/showthread.php?t=59423)

Gambet 06-14-2005 04:22 PM

Scripting: Line Counter
 
Maybe a level editor and RC add-on which shows the line that you are currently in as you are scripting. Maybe in like a box on one of the sides or so.

Example:

NPC Code:

//#CLIENTSIDE <--While typing this it would read: Line 1
if (created) <--While typing this it would read: Line 2
{ <--While typing this it would read: Line 3
actions; <--While typing this it would read: Line 4
} <--While typing this it would read: Line 5




Also: Possibly an add-on where everything added (scripted) to/on NC is given a line count number on the side of it.


Would be useful for reading errors given by the GS2 script compiler and would really just make things easier for servers that need to fix certain parts of scripts and they would be able to describe which part is needed fixing by giving the line count (example: Lines 20 through 26) to the NAT(s) of the server.

Crono 06-14-2005 04:52 PM

that would only be useful if you script in that style. some people still do the whole

NPC Code:

if (playertouchsme) {message hai;} if (strequals(#a,Gerami)) {if (playerenters) {show;}}


osrs 06-14-2005 04:58 PM

I don't think that '//#CLIENTSIDE' should count, but the idea is good.

Gambet 06-14-2005 05:03 PM

Quote:

Originally Posted by Gerami
that would only be useful if you script in that style. some people still do the whole

NPC Code:

if (playertouchsme) {message hai;} if (strequals(#a,Gerami)) {if (playerenters) {show;}}



That is HORRIBLE styling. The longest script I've ever scripted is 204 lines long. If I scripted in that style for 204 lines, I'd go crazy.

xAndrewx 06-14-2005 09:31 PM

Would be better..

Ajira 06-14-2005 10:40 PM

The client TextEditor has a line # display on it.

Skyld 06-14-2005 10:50 PM

Quote:

Originally Posted by Ajira
The client TextEditor has a line # display on it.

Yes, if people are happy using the client-rc. At least the Linux RC has it.

URBANLEGEND 06-15-2005 02:50 PM

i like this idea, but they should do it like Microsoft Dev C++ with each line having a number on the side.

Gman4pwnu 06-15-2005 10:26 PM

http://rafb.net/paste/results/h7f4Ay64.html
Look to the left, thats what he means.

Or here, my 1000 dollar program does it :P
http://img139.echo.cx/img139/7335/msvc1cq.jpg

Gambet 06-15-2005 11:03 PM

Quote:

Originally Posted by Gman4pwnu
http://rafb.net/paste/results/h7f4Ay64.html
Look to the left, thats what he means.

Or here, my 1000 dollar program does it :P
http://img139.echo.cx/img139/7335/msvc1cq.jpg



That sure as hell beat my 204 line script ;[

Gman4pwnu 06-15-2005 11:34 PM

Quote:

Originally Posted by Gambet
That sure as hell beat my 204 line script ;[

Picture or the random paste I pulled off of the pastebin?

Admins 06-15-2005 11:59 PM

Quote:

Originally Posted by Skyld
Yes, if people are happy using the client-rc. At least the Linux RC has it.

It is planned that the Linux-RC will be back-ported to Windows, probably in a few weeks (needs drag&drop stuff like in the Windows RC)

Fry 06-16-2005 12:14 AM

That picture looks like the SDL example.

Quote:

Originally Posted by Stefan
It is planned that the Linux-RC will be back-ported to Windows, probably in a few weeks (needs drag&drop stuff like in the Windows RC)

Some krazy order, but sounds good, that linux RC's great.

Gman4pwnu 06-16-2005 03:33 AM

Quote:

Originally Posted by Fry
That picture looks like the SDL example.


Some krazy order, but sounds good, that linux RC's great.

Yea, its out of an SDL tutorial.

You guessed that because of the letter SDL everywhere? :)

Gambet 06-16-2005 04:02 AM

Quote:

Originally Posted by Gman4pwnu
Picture or the random paste I pulled off of the pastebin?


The picture.

Gman4pwnu 06-16-2005 07:51 AM

Why? its half the size gambet, only 102 lines total...
NPC Code:

#include <stdlib.h>
#include <iostream>
#if defined(_MSC_VER)
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif

SDL_Surface *screen;
#define PUTPIXEL(x,y,c) \
((unsigned int*)screen->pixels)[(x) + (y) * (screen->pitch / 4)] = (c);

int SWIDTH=1280, SHEIGHT=1024;

void render()
{
// Lock surface if needed
if (SDL_MUSTLOCK(screen))
if (SDL_LockSurface(screen) < 0)
return;

// Ask SDL for the time in milliseconds
int tick = SDL_GetTicks();

// Declare a couple of variables
int i, j, yofs, ofs;

// Draw to screen
yofs = 0;
for (i = 0; i < SHEIGHT; i++)
{
for (j = 0, ofs = yofs; j < SWIDTH; j++, ofs++)
{
((unsigned int*)screen->pixels)[ofs] = i * i + j * j + tick;
}
yofs += screen->pitch / 4;
}
PUTPIXEL(10, 10, 0xff0000);
PUTPIXEL(11, 10, 0xff0000);
PUTPIXEL(10, 11, 0xff0000);
PUTPIXEL(11, 11, 0xff0000);
// Unlock if needed
if (SDL_MUSTLOCK(screen))
SDL_UnlockSurface(screen);

// Tell SDL to update the whole screen
SDL_UpdateRect(screen, 0, 0, SWIDTH, SHEIGHT);
}


// Entry point
int main(int argc, char *argv[])
{
std::cout << "Lance Leone you gonna get raped.";
// Initialize SDL's subsystems - in this case, only video.
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}

// Register SDL_Quit to be called at exit; makes sure things are
// cleaned up when we quit.
atexit(SDL_Quit);

// Attempt to create a 640x480 window with 32bit pixels.
// screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);
screen = SDL_SetVideoMode(SWIDTH, SHEIGHT, 32, SDL_SWSURFACE);

// If we fail, return error.
if ( screen == NULL )
{
fprintf(stderr, "Unable to set 640x480 video: %s\n", SDL_GetError());
exit(1);
}

// Main loop: loop forever.
while (1)
{
// Render stuff
render();

// Poll for events, and handle the ones we care about.
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_KEYDOWN:
break;
case SDL_KEYUP:
// If escape is pressed, return (and thus, quit)
if (event.key.keysym.sym == SDLK_ESCAPE)
return 0;
break;
case SDL_QUIT:
return(0);
}
}
}
return 0;
}


KuJi 06-16-2005 08:43 AM

Gman, that's not a npc code.

Gman4pwnu 06-16-2005 10:02 AM

Quote:

Originally Posted by KuJi
Gman, that's not a npc code.

Obviously not... its C++.........................

Gambet 06-16-2005 05:55 PM

Ah, I guess I mistook the picture with the URL.

I meant the URL since it has about 300 something lines.

Curt1zzle 06-16-2005 07:58 PM

Quote:

Originally Posted by Gman4pwnu
Obviously not... its C++.........................

Where'd you copy+paste that from?

Gman4pwnu 06-16-2005 11:31 PM

Quote:

Originally Posted by Curt1zzle
Where'd you copy+paste that from?

My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?

Curt1zzle 06-16-2005 11:33 PM

Quote:

Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?

Why'd you have to use ill language on me?

Oh well.

Fry 06-17-2005 12:08 PM

Quote:

Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?

You've got serious mental problems.

vahn32 06-17-2005 12:42 PM

Quote:

Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?

sup dawg. u wnt 2 rol wif mi? dawg im down wif dah c++'s and the visual bazicz al 'round dis hewd.

Why do people who complain about people who insult them because the person makes themself out to look like an idiot and then get angry because they are an idiot?
Maybe if you weren't an idiot, people would stop insulting you. :D

EmpireOwnsYou 06-20-2005 12:24 PM

Quote:

Originally Posted by vahn32
sup dawg. u wnt 2 rol wif mi? dawg im down wif dah c++'s and the visual bazicz al 'round dis hewd.

Why do people who complain about people who insult them because the person makes themself out to look like an idiot and then get angry because they are an idiot?
Maybe if you weren't an idiot, people would stop insulting you. :D

LoL! So True! Hey don't you program in some like crappy programming language? What was it again? And yes i'd love to see this feature!

xAndrewx 06-21-2005 12:55 PM

No language is crappy, you're just to lazy to learn the benefits.

Kaimetsu 06-21-2005 04:17 PM

Quote:

Originally Posted by xAndrewx
No language is crappy

How would you support this statement?

xAndrewx 06-21-2005 04:49 PM

Because you learn something new in each language.

Kaimetsu 06-21-2005 05:11 PM

Quote:

Originally Posted by xAndrewx
Because you learn something new in each language.

So...?

xAndrewx 06-21-2005 05:39 PM

Well, if he doesn't understand the language, wouldn't you 'learn' the language to understand what you're doing?

Kaimetsu 06-21-2005 05:45 PM

Quote:

Originally Posted by xAndrewx
Well, if he doesn't understand the language, wouldn't you 'learn' the language to understand what you're doing?

Yes. So?

xAndrewx 06-21-2005 05:47 PM

I'm pretty sure I saw GMan post something about not bothering to learn any languages without a reason o_o.

Kaimetsu 06-21-2005 05:48 PM

Quote:

Originally Posted by xAndrewx
I'm pretty sure I saw GMan post something about not bothering to learn any languages without a reason o_o.

How is this relevant to the claim that "no language is crappy"?

xAndrewx 06-21-2005 05:52 PM

Quote:

Originally Posted by Kaimetsu
How is this relevant to the claim that "no language is crappy"?

You asked how it was relevant to the subject. I made a mistake by thinking he posted it in this thread. I was wrong.
And why do you learn another language?
A language wouldn't have been invented if it didn't have a purpose.

Kaimetsu 06-21-2005 06:02 PM

Quote:

Originally Posted by xAndrewx
A language wouldn't have been invented if it didn't have a purpose.

Having a purpose automatically means that it is not "crappy"?

xAndrewx 06-21-2005 09:18 PM

Would you say a certain language is pointless to learn?

Kaimetsu 06-21-2005 09:20 PM

Quote:

Originally Posted by xAndrewx
Would you say a certain language is pointless to learn?

How is this relevant to the claim that "no language is crappy"?

xAndrewx 06-21-2005 09:24 PM

Quote:

Originally Posted by Kaimetsu
How is this relevant to the claim that "no language is crappy"?

Because you seem to have an opinion that a certain language you do not wish to state is crappy, else you wouldn't let this thread carry on.

Kaimetsu 06-21-2005 09:32 PM

Quote:

Originally Posted by xAndrewx
Because you seem to have an opinion that a certain language you do not wish to state is crappy

How are my opinions relevant to your claim?

So many posts, and still you haven't given an argument for its validity.

xAndrewx 06-21-2005 09:53 PM

Quote:

Originally Posted by Kaimetsu
How are my opinions relevant to your claim?

So many posts, and still you haven't given an argument for its validity.

All I am saying is
"What is the point in learning a language if you don't gain anything from it?"


All times are GMT +2. The time now is 10:01 PM.

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