![]() |
Scripting Ideas
Here are some ideas I think would be good to add to graal scripting (please don't tell me to
tell stefan just because I have debug access, he told me to only tell things that are changes to the scripting engine and to post general changes here) 1.) synxtax: stripcharacters(character,text); used: serverside & clientside example of usage: stripcharacters(«,#s(this.text)) why this would be useful: in my example it would look at the string #s(this.text) and replace all the « character's with a space I can't use tokenize2 because tokenize2 is for an ADDITIONAL delimeter, so if I used tokenize2 on the script I needed it for, it would also divide things that are normally spaced into tokens I would prefer having this than doing what I made as a replacement; NPC Code: there are probably other ways to do this but wouldnt a script command/function that did this require less processing time? EDIT: stefan reminded me that I can use indexof for this :) new replacement NPC Code: so I don't really need this anymore ^_^ 2.) syntax:var = getnearesttile(type); used: serverside example of usage: i = getnearesttile(8); why this would be useful: pretend in the example, 8 is water type, the script would automatically find the closest water tile and make i = 0/{x,y,z}, replccing each letter with the correct axis, could be used for things like pets if you want to get the nearest water tile, again i could do a loop but what would require less processing time ?? 3.) syntax: with(getlevel(levelname)) used: serverside example of usage: with(getlevel(onlinestartlocal.nw)) why this would be useful: it could be used to get all the players, npcs, and the tileset board of another levelwithout actually warping to the level 4.) syntax: showonplayerlist; used: serverside on database npcs example of usage: see syntax why this would be useful: they could recieve if(pm) as an action as well, it would be fun to add npcs to the playerlist and why bother having the Control-NPC recieve even more actions than it already does and take up more proccessing time by making it into an FAQ bot when you can do it withanother npc?? 5.) syntax: deletestrings stringstart,begin index,end index; used: clientside and serverside example of useage: deletestrings this.item,0,100; why this would be useful: the example will delete #s(this.item0), #s(this.item1), all the way to #s(this.item100) I think this would take less processing time than for(i=0;strlen(#s(this.item#v(i))) > 0;i++) setstring this.item#v(i),; 6.) a way to define if something you draw with showpoly gets filled or not x.x if I think of more ideas I will reply and post them or edit this post also, don't say that accessing / editing files on the server's ftp would also be useful, Stefan has already said he will add this later |
Re: Scripting Ideas
Quote:
|
Re: Re: Scripting Ideas
Quote:
|
Re: Re: Scripting Ideas
Quote:
|
Too confusing for me. o.o
*Runs away* |
Re: Scripting Ideas
Quote:
NPC Code: |
Re: Re: Scripting Ideas
Quote:
|
Only database NPCs can warpto.
Any NPC could getlevel, as it would access the players, npcs, board, and level variables of the level without needing to warp a database NPC into the level to bounce things back, a relatively inefficient process. I have a secret project for which something like this would be most useful... |
| All times are GMT +2. The time now is 04:20 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.