Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Shared functions pack (https://forums.graalonline.com/forums/showthread.php?t=81277)

Kristi 08-18-2008 05:19 PM

Quote:

Originally Posted by Tigairius (Post 1415512)
I don't see why Skyld can't upload it for you if they're already made.. ?

That would make my job rather silly :)

Cloven 08-18-2008 06:01 PM

Quote:

Originally Posted by Kristi (Post 1415514)
That would make my job rather silly :)

Or not..

Skyld 08-20-2008 12:34 AM

Okay, these functions are now available on the main login server, for all players and servers. :)

devilsknite1 09-14-2008 07:26 PM

I just fell in love / fainted / any other word here. YAY! <3

Skyld 05-30-2009 01:27 AM

Added shared.getAlignmentColor(int ap); and shared.getAlignmentShadowColor(int red, int green, int blue); by request, both returning an array of {red, green, blue}.

DustyPorViva 05-30-2009 02:02 AM

Could you perhaps add my replacetext function(or a better one, as long as one is available)?

http://forums.graalonline.com/forums...ad.php?t=82820

Skyld 05-30-2009 02:10 AM

Quote:

Originally Posted by DustyPorViva (Post 1495360)
Could you perhaps add my replacetext function(or a better one, as long as one is available)?

http://forums.graalonline.com/forums...ad.php?t=82820

Added it to shared.replacetext(string, search, replace).

Also added a function called shared.getSharedFunctions() which returns an array of public functions provided by the shared function pack.

Crow 05-30-2009 11:17 AM

Awesome Skyld, thank you!

Tigairius 05-30-2009 02:14 PM

Quote:

Originally Posted by Skyld (Post 1495357)
Added shared.getAlignmentColor(int ap); and shared.getAlignmentShadowColor(int red, int green, int blue); by request, both returning an array of {red, green, blue}.

Quote:

Originally Posted by Skyld (Post 1495362)
Added it to shared.replacetext(string, search, replace).

Also added a function called shared.getSharedFunctions() which returns an array of public functions provided by the shared function pack.

These things are pretty nice :D

DustyPorViva 06-20-2009 09:34 PM

Could you also add this?
PHP Code:

function tiles(cx,cy,cw,ch) {
  
temp.ctiles = new[0];
  for (
temp.i=0;i<cw*ch;i++) {
    
ctiles.add(tiles[int(cx+(i%cw)),int(cy+int(i/cw))]);
  }
  return 
ctiles;


player.chat = tiles(x,y,width,height);
Would return an array of all tiles within the 'blocl' given. I get tired of having to run loops all the time to check a block of tiles.

DustyPorViva 06-29-2009 07:41 PM

The AP shadow function returns 0,0,0 for gold ap, which isn't right.

It should have a check:
if (params[0] == 224 && params[1] == 196 && params[2] == 0) return {255,255,0};

Or something like that.

fowlplay4 07-18-2009 08:20 PM

Couldn't hurt..

PHP Code:

function capitalize(str) {
  return 
str.charat(0).upper() @ str.substring(1);



Tigairius 01-06-2010 02:38 AM

1 Attachment(s)
Added a new clientside function, you can access it like so:
PHP Code:

shared.adminMessage("You have been disconnected because you did not move for more than 30 minutes."); 

It supports html tags as well.

Attached a screenshot of it so you know what it's doing.

Basically, it'll open a window (like so) that will remain open even when changing servers, so, for example, if you wanted to open a window before you serverwarp() someone, it's possible now, and they will see the message even when they're on the login server.

DustyPorViva 01-06-2010 05:02 AM

Yes please?

PHP Code:

function repeat(char,num) {
  
temp.output "";
  for (
temp.i=0;i<num;i++) output @= char;
  return 
output;


I ran into a script earlier that made me wish there was a repeat character function. I think something like this would be useful for anyone who needs to format text.

Also, with these functions are variable names an issue? For example, if I use shared.repeat(" ",5) in a loop that also uses temp.i, is it going to break?

cbk1994 01-06-2010 05:11 AM

Quote:

Originally Posted by DustyPorViva (Post 1548518)
Also, with these functions are variable names an issue? For example, if I use shared.repeat(" ",5) in a loop that also uses temp.i, is it going to break?

temp variables are specific to the function, so no.


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

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