Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   downloadsize (https://forums.graalonline.com/forums/showthread.php?t=55239)

ZeroTrack 09-06-2004 08:59 PM

downloadsize
 
How come downloadsize it returning zero everytime? simple test will prove it does

if(created||timeout){
setplayerprop #c, #D #v(downloadpos) / #v(downloadsize);
timeout = .05;
}

Notice the var downloadsize comes up 0

osrs 09-06-2004 10:10 PM

If there is no current download, the variable will become 0, are you running the script client-side? I may be wrong but I think it doesn't work server-side.

ZeroTrack 09-06-2004 11:41 PM

yea its clientside, and #D work as such

#D,#D(filename)

The player chat i got was this

filename.png 32000 / 0
this script returned this to RC :
NPC Code:

if(actionserverside)
sendtonc Downloading:#p(0) #p(1) / #p(2);
//#CLIENTSIDE
if(created||timeout){
timeout=.5;
triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;
}



Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 256000 / 0
Downloading:bravo_tileset.png 256000 / 0

osrs 09-07-2004 12:04 AM

Your script is pretty insecure, you don't really need to use sendtonc and even inside a timeout loop.
It is returning 0, because of this:

triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;

The name of the variable is downloadsize, and you used space.

ZeroTrack 09-07-2004 12:11 AM

no i didnt the fourm made it that way for some reason, which leads me to believe that the gserver is doing it too, and the sendtonc is for debuging

Tolnaftate2004 09-07-2004 01:55 AM

Maybe you should try:
sendtonc Downloading:#p(0) #p(1) / #v(downloadsize);

It may just be that the client doesn't know how large the file is because it has yet to download?

ZeroTrack 09-07-2004 02:06 AM

Quote:

Originally Posted by Tolnaftate2004
Maybe you should try:
sendtonc Downloading:#p(0) #p(1) / #v(downloadsize);

It may just be that the client doesn't know how large the file is because it has yet to download?

hmm no that didnt work but that shouldnt matter cause the newfeatures doc states

-new scripting variable 'downloadsize': when the
graal client is currently downloading a big file
(>32k) then this variable contains the size of the
file

ZeroTrack 09-07-2004 03:34 PM

Has anyone figured out this problem yet?

Tseng2 09-16-2004 10:19 PM

Quote:

Originally Posted by ZeroTrack
no i didnt the fourm made it that way for some reason, which leads me to believe that the gserver is doing it too, and the sendtonc is for debuging

You put a space in there - the forum does not insert spaces there, and the supposition that the server does so is laughable. Use the proper variable if you wish the proper result. If you still have a problem, post your revised code and we will have a look at it.

napo_p2p 09-17-2004 01:36 AM

Quote:

Originally Posted by ZeroTrack
yea its clientside, and #D work as such

#D,#D(filename)

The player chat i got was this

filename.png 32000 / 0
this script returned this to RC :
NPC Code:

if(actionserverside)
sendtonc Downloading:#p(0) #p(1) / #p(2);
//#CLIENTSIDE
if(created||timeout){
timeout=.5;
triggeraction 0,0,serverside,Sern,#D,#v(downloadpos),#v(download size),;
}



Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 32000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 64000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 96000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 128000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 160000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 192000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 224000 / 0
Downloading:bravo_tileset.png 256000 / 0
Downloading:bravo_tileset.png 256000 / 0

I tried that with #v(downloadsize) instead of #v(download size) and got the same thing.

Bug perhaps?

ZeroTrack 09-17-2004 01:59 PM

Quote:

Originally Posted by Tseng2
You put a space in there - the forum does not insert spaces there, and the supposition that the server does so is laughable. Use the proper variable if you wish the proper result. If you still have a problem, post your revised code and we will have a look at it.

LANCE! post the code your-self without a space and watch what happens , i know what im doing i wouldnt put a space there, if you dont know the awnser then dont comment, please try posting the code youself then you'll see so you can put that foot back in your mouth

and BTW! read the first post here i did without using the code tags, ... oh whats that ?? its not spaced? oh loookk at thatt

osrs 09-17-2004 02:02 PM

Geez, he is trying to help, don't be so rude.

Dach 09-17-2004 02:28 PM

NPC Code:

message #v(downloadsize);



Edit: works?

ZeroTrack 09-17-2004 06:02 PM

na i tired that too returns 0 still

Dach 09-17-2004 07:12 PM

Quote:

Originally Posted by ZeroTrack
na i tired that too returns 0 still

I was reffering to the forums x_x

huh, it seems to work fine in v3, but not 2 :\

Lance 09-17-2004 07:59 PM

Quote:

Originally Posted by osrs
Geez, he is trying to help, don't be so rude.

I'm not being rude - I'm pointing out when someone else is incorrectly blaming someone or something else for something they did themselves.

The first thing for one to do when they have a problem should not be to say "There's something wrong with the system." but instead, ask yourself "What could I possibly be doing wrong?"

osrs 09-17-2004 09:32 PM

Quote:

Originally Posted by Lance
I'm not being rude - I'm pointing out when someone else is incorrectly blaming someone or something else for something they did themselves.

The first thing for one to do when they have a problem should not be to say "There's something wrong with the system." but instead, ask yourself "What could I possibly be doing wrong?"

I should have quoted, but I was talking to Sern.

ZeroTrack 09-18-2004 04:40 PM

Quote:

Originally Posted by Dach
I was reffering to the forums x_x

huh, it seems to work fine in v3, but not 2 :\

Why is that....

Malinko 09-18-2004 08:20 PM

Quote:

Originally Posted by ZeroTrack
How come downloadsize it returning zero everytime? simple test will prove it does

if(created||timeout){
setplayerprop #c, #D #v(downloadpos) / #v(downloadsize);
timeout = .05;
}

Notice the var downloadsize comes up 0

NPC Code:
//#CLIENTSIDE
if (created || timeout) {
if (strlen(#D)>0) {
setplayerprop #c,#D;
showtext 201,1,1,comic sans ms,,#D;
changeimgvis 201,8;
changeimgzoom 201,11/textheight(comic sans ms,,1);
for (this.i=0;this.i<int(downloadpos/downloadsize*100);this.i++) {
showtext 300+this.i,1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;
changeimgvis 300+this.i,8;
changeimgzoom 300+this.i,11/textheight(comic sans ms,,1);
}
} else {
hideimg 201;
hideimgs 300,400;
}
timeout = .05;
}



Edit: Had to fix something. Erm, it should work, haven't tested so.

xAndrewx 09-18-2004 08:34 PM

Nice work malinko, I see why you are part of the debug team :P

Tolnaftate2004 09-18-2004 09:22 PM

NPC Code:
1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;



The same error in my original one, how bizarre. :)
And it's also strange that you would use font comic sans ms everywhere but there.

And if downloadsize is 0, as is the problem, it can't divide by 0.

ZeroTrack 09-18-2004 09:32 PM

Quote:

Originally Posted by Malinko
NPC Code:
//#CLIENTSIDE
if (created || timeout) {
if (strlen(#D)>0) {
setplayerprop #c,#D;
showtext 201,1,1,comic sans ms,,#D;
changeimgvis 201,8;
changeimgzoom 201,11/textheight(comic sans ms,,1);
for (this.i=0;this.i<int(downloadpos/downloadsize*100);this.i++) {
showtext 300+this.i,1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;
changeimgvis 300+this.i,8;
changeimgzoom 300+this.i,11/textheight(comic sans ms,,1);
}
} else {
hideimg 201;
hideimgs 300,400;
}
timeout = .05;
}



Edit: Had to fix something. Erm, it should work, haven't tested so.

Doesnt work for me.....

Tolnaftate2004 09-18-2004 09:35 PM

Quote:

Originally Posted by ZeroTrack
Doesnt work for me.....

For half a moment, it should say what you're downloading right when you log on. I've never seen it show anything while you're playing.

Python523 09-18-2004 09:48 PM

I'm thinking the var is bugged, didn't work for me really when I tested it a day or so ago

ZeroTrack 09-18-2004 11:08 PM

Quote:

Originally Posted by Python523
I'm thinking the var is bugged, didn't work for me really when I tested it a day or so ago

excatly what i think

Malinko 09-18-2004 11:16 PM

Quote:

Originally Posted by Tolnaftate2004
NPC Code:
1+textwidth(comic sans ms,,11/textheight(verdana,1),|),13,comic sans ms,,|;



The same error in my original one, how bizarre. :)
And it's also strange that you would use font comic sans ms everywhere but there.

And if downloadsize is 0, as is the problem, it can't divide by 0.

I think that is yours. Did you name it -Download on #gscript?

Tolnaftate2004 09-19-2004 12:47 AM

Quote:

Originally Posted by Malinko
I think that is yours. Did you name it -Download on #gscript?

-pfa/downloads :]

But you are a debugger and missed that? Shame ;)

xAndrewx 09-19-2004 02:16 PM

Everyone pakes mistakes pfa, I mean look what you did to UN, You can just about do anything on UN..

Tolnaftate2004 09-19-2004 07:44 PM

Quote:

Originally Posted by xAndrewx
pakes mistakes pfa

Yup, yup.
And it wasn't intended to be mean.

But I didn't make most, if any, of the buggy stuff on UN.

Admins 09-21-2004 05:08 PM

It seems that the modifications for the "downloadsize" variable were accidently removed in the last Graal v2 release, so the variable doesn't contain something right now except you are running v3. In the next version (will be released in a few weeks) it will be fixed.

xAndrewx 09-21-2004 06:49 PM

When will the new scripting engine be out?;o

zokemon 09-22-2004 08:01 PM

Quote:

Originally Posted by xAndrewx
Nice work malinko, I see why you are part of the debug team :P

I don't...

ZeroTrack 09-23-2004 01:57 PM

Quote:

Originally Posted by Stefan
It seems that the modifications for the "downloadsize" variable were accidently removed in the last Graal v2 release, so the variable doesn't contain something right now except you are running v3. In the next version (will be released in a few weeks) it will be fixed.

woo Sern found a bug =D *does the cabbage patch* and you'll thought i was scripting wrong =p

Lance 09-27-2004 07:02 AM

Quote:

Originally Posted by ZeroTrack
woo Sern found a bug =D *does the cabbage patch* and you'll thought i was scripting wrong =p

Hey, you are actually right for once. Good job.

ZeroTrack 09-27-2004 06:36 PM

Quote:

Originally Posted by Lance
Hey, you are actually right for once. Good job.

Lance you love me right? im a good kid =D


All times are GMT +2. The time now is 06:01 AM.

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