Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Total height of a GuiScrollCtrl (https://forums.graalonline.com/forums/showthread.php?t=134257402)

cbk1994 12-22-2009 07:14 AM

Total height of a GuiScrollCtrl
 
Is there any way to find the "total height" of a GuiScrollCtrl, meaning how far "down" it will actually scroll (same for horizontal scrolling)? I know you could get it by looping through all the controls, but it seems like there should be a better way.

Thanks.

fowlplay4 12-22-2009 09:05 PM

Something like this would probably suffice, kind of a hack fix though.

PHP Code:

//#CLIENTSIDE

// Usage: getMaxScrollPos(someScrollGUI);
// Returns: {maxhorizontalpos, maxverticalpos}


function getMaxScrollPos(obj) {
  
// Record Original Scroll Position 
  
temp.original obj.scrollpos.tokenize(); 
  
// Scroll to the Limits 
  
obj.scrolldelta(0x7fffffff0x7fffffff);
  
// Record Actual Limits 
  
temp.max obj.scrollpos.tokenize(); 
  
// Scroll back to Original Position 
  
obj.scrollto(temp.original[0], temp.original[1]);
  
// Return Actual Limits 
  
return temp.max



Demisis_P2P 12-23-2009 03:49 AM

is this related to the other thread about freezing players by spamming them with PMs??

cbk1994 12-23-2009 05:42 AM

Quote:

Originally Posted by Demisis_P2P (Post 1546444)
is this related to the other thread about freezing players by spamming them with PMs??

No, it's for creating custom scrollbars.

coreys 12-23-2009 05:50 AM

Quote:

Originally Posted by Demisis_P2P (Post 1546444)
is this related to the other thread about freezing players by spamming them with PMs??

...no?

Demisis_P2P 12-23-2009 07:07 AM

I'm retard. I thought that maybe you were trying to detect the total size of a PM bank based on the scroll bar and stop them from opening if it were too large. But now that I think about it you would need to open the PM first to be able to detect anything about the GUI window anyway.

fowlplay4 12-23-2009 07:34 AM

Quote:

Originally Posted by Demisis_P2P (Post 1546466)
I'm retard. I thought that maybe you were trying to detect the total size of a PM bank based on the scroll bar and stop them from opening if it were too large. But now that I think about it you would need to open the PM first to be able to detect anything about the GUI window anyway.

I wouldn't consider this a reliable way to catch it anyway, but there really needs to be an image spam prevention, and one that prevents linking non-images since you can freeze someone by image tagging things like Linux ISOs (which can be prevented using wordfilter rules until then).

coreys 12-23-2009 08:54 PM

The PM spam crashing trick doesn't work on someone using Linux, I've found, now it just needs to be fixed for other platforms. :)


All times are GMT +2. The time now is 12:29 PM.

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