Jump to content

Clickable Objects Features

Recommended Posts

Perhaps... Set a ritual in a clickable ("your under attack by ...") with x stats and principles. Possibly those of whoever made the script. And then print x in case of win, print y in case of loss (of course, counted like demo, no exp no wins no VE loss). Or even "X" for a Sword, "Y" for a win, "Z" for a loss, "Q" for a sheath. And perhaps even add restrictions to creatures/stats/principles used by whoever clicks the object for example don't allow tokens or drachorns. It'd add some tactical insight to the items. Another thing which might/would be possible is adding a limited number of tries (say 10) so sheer luck cannot pass the requirement.


I realize adding the combat system to the clickables is probably a lot of work. (Not exactly sure, don't know that much about coding)

And something else I just thought off:

Returning flash variables and embedded flash objects would enable users to make puzzles like the broken pattern themselves. I know Cutler has made quite a few on his page, it'd be nice to have stuff like that in steps of a quest for a change to the all the "text based" decryption and riddles (not that there's anything wrong with that, it's just nice to have some variety)

My apologies in advance in case I used any wrong terms in my text


Edited by Observer
Link to post
Share on other sites
  • Replies 85
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

A note on user variables, the current list of variables which can be accessed through MDscript miss a couple of useful possibilities. Now that principles can be changed and have a maximum value of

Anyone here heard of the song by Lonely Island? "Jizz in my Pants?" This nearly applies here.

I would like to see an implementation of automated features like teleport and stat boosts. If we could make quests like the story line, (actual quests not Useless things like most rpcs had) I can se

A option to limit amount of keys that an item can give is also interesting. That way, participants can be limited to a certain amount. It can also be used for periodic quests, so the quest will only allow a fixed amount of participant/winner each month (or other time frames), and automatically be available again for new entrants after a certain of time passes. And maybe an option to make some keys expire after a certain time?

Link to post
Share on other sites

how about a random generator so someone may go to a spot and see something and maybe sees "you find a box on the ground" and they type "open" it could be either an amulet or a ring or something or give a random quest path... i dunno if im explaining it very well because i just woke it :P

Link to post
Share on other sites

A random function is already available :P
Limitation on the number of keys an item provides can be done within the current framework too, think about the store holding the number of keys, or which keys are allowed. When a key is given it would remove it from the store for example.

Link to post
Share on other sites

exirable keys are not an option. You can achieve same by changing the key you are checking for. Addin a limit to number of keys could be useful to prevent abuses but will also limit things a lot. I can add a limit for giving someone a key to many times within same script. For example an abuse script would give an other player 1000000 keys just to overload his keyholder and crash his account. Anythign is possible, mdscript does not restrict at all all possible abuses ..for some of them other types of restrictions are required (like hunt and kill/ip ban for main an alts type of thing).

sending data to flash is possible by using current tools. Just do a template for the output string, replace it with the values you want, and you have your data to load in flash.

Sit down, please, here goes SF-MD-PHP-Sript :P

Updated planed features list:

- creature transfers by mdscript
- item transfers
- user input (forms)
- fights triggered by script, trackable by script (not sure if i can) (good for checkpoints, trials, competitions)
- check for player creature, vitality, xp, type, tokens, level, etc (assamble army missions, creature collector, etc)
- check for fight counts against a player (search and destroy missions, bounty, etc)
- add name of editor to the entry title for the item, indicating if it has script on it or not, and how many lines it has.
- pseudo SQL to handle data in arrays like they are a database, useful for user created filters and more, not sure how much memmory that will eat
- wp awarding by script
- magic spells triggered by script (turns items into healing shrines, and such, unlimited possibilities)
- illusions triggered by script (like you kiss the prince and it turns into a frog, or ..the opposite)
- ability to give things to the objects, like send creature or item to an object and that item becomes available to use by script (automated markets, take and give quests, package delivery, etc)
- ability to give heat to the objects and objects to count that cross user. (unlimited possibilies of use in combination with the other features)
- more?

maybe needed:
- treasure chests , sort of "things" to hold items, creatures or even ritual configurations for use by script so that they don't get deleted by owner. For example if you want to give an item by script, you have to place it in a treasure chest, and you cant take it back from there (you can by script if you realy want to)
- mixing fighting NPCs with clickable objects, not sure if possible. Right now the Loreroot guards do this, but in a very customized way.
- rating stars for item entries

The current changes are major, so i move it from v0.1 to v1.0 ... but if i manage to do those things listed above or some of the most important of them, it will get 2.0 directly. Heat thing, figthing, and item storage on clickables are the most difficult and i am not sure if they will get done. It might be that the most complicated things to motivate me the most and get done before the simple ones, we shall see.

Main issue with these features is preventing abuse.

Anyway, i plan to launch it soon, as it is, because i will take about a week of vacation and i dont think i can finish anything of those before that. I need testers for a preliminary test before i make whats allready done public. I need people willing to try to abuse it and find issues with it, experienced with coding is best. I also need creative people that can write example codes of interesting you coudl do with the current features.

Link to post
Share on other sites

ill put my account on the line for a chance to test the features as well as finish my treasure hunt quest with a few (hopefully glitch free) surprises :)

also ill admit im not the best scripter, but im not the worst either :P

Link to post
Share on other sites

- user input (forms) DONE
you can now use forms in your scripts and process user input O.o
Combine that with template loops, and data storage and you build your own store within md, with cart and product categories .... but without payments :P
Unless your creativity comes up with somehting untill i do the rest of the features

SHORT tutorial coming up now, sciprt gets public after the tutorial, tonight, no more tests, if you erase md from the server, so be it :)

Have fun

Link to post
Share on other sites

I do have one feature to request.

I would really love a time vars. For instance, an block of coding only runs on a certain day, or on a certain time. They should be independent of each other as well, so that you can have something happen every day at a time, or every tuesday, or once a month.

Would that be doable?


Link to post
Share on other sites

did i say SHORT? oh well..

[b]Restrictions and Errors[/b]
There are a lot of usual words that you are not allowed to use in your scripts. Try to rename them and avoid warnings. It is not a syntax check, its a broad check over what you type there in your little green scripting box to avoid exploits. Most red errors mean your script was not parsed because it did not pass the security checks. If your script gets parsed but you run into a nasty fatal error that stops loading the page, you will have a blue "edit in case of error" link so you can edit and fix the script.

You used words or signs that are not allowed, simply rename them

Same as above. They cover a larger number of words and letter combinations. Same issue may cause an error in multiple error groups, but once you fix it they will all dissapear.

This means you tried to use a php function or keyword that is not supported. About 250 php functions are supported, out of thousands probably. You should have plenty of tools to play with but some things are just not safe for general use. If you think a function you could use is not available and its harmless, make a request and i will analyze it.

These are odd errors, but they are needed. Sometimes it makes no sense why you can't use a group of characters one after an other, but its mainly to prevent abuses you never dreamed of. Try to use something else, rename, reorder, etc.

[b]Fatal Errors and Parse Errors[/b]
These could be black ugly errors or red errors. This mean your script was compiled but failed to run. If you get a line number out of it, lucky you. Search that line for a possible mistake, a lost quote, a missing bracket or a missing ";" at the end of the line, etc. If the line is the last one in your script, you probably left a bracket open, see that all open brackets { match a closing bracket }.
Not all the time the error that is written is helpful to know what happend. You should check your script open minded and not got stuck in the hint that the error message gives.

[b]MDScript Warnings[/b]
These are very useful warnings to tell you things that happen with your script. The errors are very targeted and explain most of what is going on. You should read them and try to fix the script so that you won't get any. In case the warnings can not be fixed or should not be fixed, there is a bypass function to hide the warnings, but use it ONLY when you are sure you understand all of them and you are sure they do not affect the functionality of the script.

[b]Hide MDScript Warnings Function:[/b]

//place it anywhere in the code

This will not stop other errors than MDScript Warnings


Variables are what store data. In normal PHP language they are almost any string that starts with a dollar sign $. In MD script i had to change that for security reasons and make variables start with @ and have a predefined na,e. You can use only a few predefined variable names, use them wisely and they will be sufficient. You can use arrays too so you could fit an unlimited number of keys into one array if you are realy in big need of a large number of variables.

26 general use variables
@va to @vz

3 dedicated variables named more conveniently so you have things easyer to follow
They are tehnicaly the same as the 26 general use variables, they just have nice names
@tpl , to be used for template replacement values
@temp to be used for temporary things like loading values and then storing them into an other array
@log to be used for storing logs during script execution or anything else that fits the name

3 special variables
@input , this will get filled automaticaly with anything sent from a FORM (user input!)
@content, this is an array that hold each of the content sections that you separate by the content separator in the content editing field, the other field besides the script editing field.
@storage, gets loaded with data by the mds_storage() function. All data in this array gets saved to the database as a storage. Set data in the right indexes and after initiating storage or your script will get warnings if you set this var chaoticaly.


[b]Managing Content Sections[/b]
In the content sections you put all text, stories, forms, templates, javascript and all things that are not MDScript code. Instead of putting all content in one big piece, you can separate it by placing a content separator, thats exactly this string: [i]<!-- content section -->[/i]
All the pieces of content separated by such a separator, will be available for use in the MDScript under the @content array starting at index zero.


Content part 1
<!-- content section -->
Some other content
<!-- content section -->
A template [[test]] with variables
<!-- content section -->
A form <form ...> ... </form>

This will be in the MDScript seen as:

@content[0] = Content part 1;
@content[1] = A template ... with variables;
@content[2] = A form <form ...> ... </form>;

This way of separating content is very useful. You could display different content sections depending on different rules you set in the script. Also its very important when you use templates.




template = template to use for each data displayed. Variables in this template should be noted as [[somename]] where 'somename' can be anything
data = can be an array with keys named like the strings enclosed in [[...]] in the template or a multidimensional array for more records. Such an array has each of its items as an array with values
return = if its true, function will return the string so it can be used in the script, if its false, it will display the result directly.
columns = for multidimensional arrays, this parameter tells on how many columns they should be displayed. If its false or 1 the records will be displayed one per row. It has no use if the data array does not contain multiple records.
attributes = when displaying multiple records, they get organized in a table. The attributes parameter can contain a string to be placed inside the <td ...> tag of each cell. This could be a style an attribute but also javascript or anything that is html valid.

You can use bits of content as templates with variables.
@content[1] is the content after the first content separator
lets say for this example template code contains:

<b>[[name]]</b><br>[[rowinfo]]<br>Details: [[more]]

Script to use this template:

//make sure @tpl its empty
@tpl = array();

//do something 20 times
@tpl[@va]['name'] = "Record {@vk}";
@tpl[@va]['rowinfo'] = "Row {@vk} has value".@vv;
@tpl[@va]['more'] = "more values ...";

//call template function
mds_template(@content[1],@tpl,true,3,'style="border:1px solid"');


This will display the content in @tpl, on 3 columns, each time parsing the template in @content[1]. The style indicated in the last parameter will be used on each of the 20 table cells created.


more coming soon...

Link to post
Share on other sites

lol sounds fun to test

also not sure how to prevent abusing of this, but being able to code in teleport spells or something would be fun, like they do something wrong in the quest and get teleported to Tunnel of War (example), or something good and get teleported somewhere...nice?

Link to post
Share on other sites

[b]Debugging Your Code[/b]
Debugging is not some weird activity programmers do...well it is but if you want to do interesting things with MDScript you have to know about it. Seeing what is inside the variables you are working with is very important to understand what you should do with them next.
Simple variables are easy to check, you just output them and see what value they have:

[code]print @va;[/code]

(i usualy use 'echo' instead of 'print' , they do same thing, but print sounds easier to remember)

Best practice is to put some other value next to the one you are looking for, so that if the variable is empty, you will see that and not just an empty page not knowing if it was output or not.

[code]print "V=".@va;[/code]

This will output V=something or V= if @va has no value. Better than nothing at all.

Arrays are harder to debug by just using simple output. Multidimensional arrays are even worse. Fortunately there are functions to help you see exactly what is inside a variable.

[b]Debug Function:[/b]

variable = any kind of variable simple or multidimensional array with or wihout data
label = a label to help you identify the debug output, optional (means you can use just the variable parameter)


This will be your best friend when trying to understand what data you have in all those variables. It will generate a nice colored box with all the details you need about the internal structure of the variable you are trying to analyze

Link to post
Share on other sites

[b]Key Control[/b]
Keys are what decide what users can access in game. They are like flags to indicate all sorts of things and to track what player did and achieved. A special category of keys are the ones that you can set from the MDScript. They are just like the keys used to setup the entire realm, just that they have a prefix "rpcq-". You might notice that the same prefix is set on the Clickable items, well its no coincidence. Clickable items run as clickables if you don't have the key to access them and run as something else if you do have the key. Currently there are no clickables that have something behind them to run, but some important clickables that had are the Loreroot back entrance and the Drachorn Cave, meaning that if you got the key from a mdscript you could have entered the cave and get plenty of drachorns or have permanent access to LR back entrance. So pay attention to MDScript, it might be more interesting than you think.

Enabling more clickable items to do something behind their keys will be done if i see people realy understand how to use and not ab(use) them. Combining strict rules with total freedom might not be possible afterall, anyway the system allows it right now so who knows what will be in the future of MD.

For now, scripted keys are excelent way to track quest progress, and make scripts "know" what the player evolution with that script is.

There is a new feature for data storage, that could be used just the same way, but i strongly think that keys have a major use along with that. Data storage and keys will have different evolution path because they are tehnicaly different things. Keys are saved with the user, data is separated.

[b]Differences between data storage and keys[/b]
Data storage, unlike keys, can store lots of data of all sorts, but they also get deleted once they get empty. Its no way to track what data a user has outside the clickable objects or MDScript. Keys can be tracked in game interface and used under many circumstances. Keys are very bad for holding actual data, they are just flags that are on or off. Only info keys hold is the time and place they were received and thats for logging reasons mostly. Both keys and data storage have their advantages and disadvantages and their different uses. They are not one and the same thing, even if under current situation they have similar use.

[b]Function to manage keys:[/b]


Gives the keys to the player.


Removes/takes the keys from the player


Checks if the player has specific keys, returns true if all keys are in the players possession , false otherwise

keys = a string with all the keys you want to give , take, or check. It doesnt support arrays, the parameter should be a string with comma separated values


echo "Congrats you have all the keys";
echo "You do not have all needed keys";

if(..some rule here...){
@vk[] = 'key1';

if(..some other rule...){
@vk[] = 'key2';

@vs = implode(",",@vk);


//replace keys
//for example player just delivered a package and rceived next task

//takes initial key away, so it wont be used again
//gives other keys in replace to continue

//final key could trigger a reward

[b]Sharing keys[/b]
Keys are global. A key named "greenbox" will be the same for that player if checked by any item or script in the realm. TO avoid key collisions you should name your keys in original way or even better , you should add a prefix to them.

Example of good key names: playername-greenbox , or zzg3-greenbox, greenbox-tree-quest23
Example of bad key names: box, package, key1, somekey, general, ..

Sharing keys is very interesting when multiple editors want to syncronize their quests. For example an item scripted by an editor could check for a key given by an other editor/quest to see if that user finished that quest first.

[b]Key secrecy[/b]
Because keys can be set by any editor, keeping your keys named complicated and secret is most important to avoid cheating. If you trust all the other editors, you can ignore that advice. Other editors can not see your code, except if you script on public items (there is a special category of items that share content and script across any editor).

Link to post
Share on other sites

[b]User Vars[/b]
Properties of the user accessing the script are available to the script. Don't worry, private info is not available to the script.

Function to read user vars:

The uv() function is much shorter and easyer to use. What it does is actualy call the mds_read_uvars() function in turn.

var = a keyword that indicates what value you want to know about that player.

Available vars:

'id' = player id
've' = vitality
'vp' = value points
'xpl' = exploring points
'maxve' = maximum vitality
'maxvp' = maximum value points
'land' = land id,
'alliance' = allaince/guild id
'age' = active days
'loyalty' = loyalty points
'honor' = honor points
'name' = playername
'mp' = mindpower
'heads' = heads
'won' = won fights
'lost' = lost fights
'avatar_level' = avatar level
'avatar' = avatar id
'xp' = experience,
'kills' = kills during torch competition
'illusion' = set if player in an illusion

echo 'Run, hide, protect your head..sss';
echo 'You are alive, but you don't have so many heads with you :D ';
echo 'Well you are wery weak but you won a lot of fights so...';
echo 'get lost';


echo "Hello ".uv('name')." ";

This function can not be used to change user variables.

Link to post
Share on other sites

I have the data storage functions to document , but tomorow.
I suggest we keep MDScript documented on the forum, in a private group.
Private group because i dont want curious people over the internet to look into it :D So anyone "known" around here, or with enough posts can look into it, and defenetly anyone with access to edit script.

Keping it on forum is good because its easy to organize in a separate forum with examples, sugestions, bug tracking etc.

SAMPLE SCRIPTS is the key for a widely used mdscript and interesting quests and applications built with it.
I put great hope in this direction of MD. I know not many have any programming skills but most have good logic and thats the first and most important step. Those that do have programming background or at least a clue of it, will do amazing things i am sure. By providing sample scripts for all to see, a lot more players could use this feature.

Btw, did i mention editing clickables will be added in WP shop at a decent requirement? maybe anyone with a Q doc ... idk now..to tired to think of it right.

Feel free to move the docs i am writing here in a more organized structure or section

I am reading all your suggestions , some will get implemented. A lot of things that are now on standby and unused, like letters, OR NIGHT TIME schedule, can be added to mdscript and given a chance for fast evolution, in a different dierection its true.

Once i find a good way to balance use vs abuse, and reusability, i will be able to place much more features in the script. Right now MDScript is not fluid enough, it requires a human to supervise a quest, its rewards and what the script does. I hope i can make it so that something programmed in it will be functional and useful even long after the editor has left.

There is also the issue with not being able to edit scripts of ex=players .. not sure how to fix that and still keep secrecy of keys and quests.

Anyway, i will go on with the things i consider fun to do :D like always, and we shall see where it takes. ..but .. i will have a short time off soon, so expect more features when i return.

I will enable clickables tomorow. Dont ruin it if you find ways to do so ..i put a bounty for finding exploits..better get rewarded than punished i think :D

This is the list of available PHP functions, someone maybe can help writing documentation taken from php.net and adapted to mdscript usage . Rendril prepared the short description for each of them, but i realised its way to much to ask him to prepare sample code for each. Sample code should have some kind of originality and give a creative idea , quest related..not some copy pasted useless and faded programing examples...if you know what i mean..

Also if anyone spots a possible abuse with any of the functions, let me know, i didnt checked ALL of them so i might have missed some with issues.


'print','echo','count_chars','crc32','crypt','explode','chunk_split','htmlspecialchars','htmlspecialchars_ decode',
'get_ html_ translation_ table','printf','implode','md5','number_format','ord','chr','chop','lcfirst',



//date time




//regular expressions

ps@awi plenty of time features to play with, some are realy creative too

Btw, MD day is given by

echo date('z');

Link to post
Share on other sites

i seem to recall that there used to be issues with a requirement on the ''uvars.name'' for LHO's (and RPC's, but that doesnt apply anymore) because the code didnt recognise the *'s but the persons name had the * in it, so whilst printing, because it's recalling would work fine, typing in an LHO's name wouldnt, because of the code. Is this sorted with the new codes?

If that makes [b][i]any[/i][/b] sense at all.

Link to post
Share on other sites

[quote]Once i find a good way to balance use vs abuse, and reusability, i will be able to place much more features in the script. Right now MDScript is not fluid enough, it requires a human to supervise a quest, its rewards and what the script does. I hope i can make it so that something programmed in it will be functional and useful even long after the editor has left.

There is also the issue with not being able to edit scripts of ex=players .. not sure how to fix that and still keep secrecy of keys and quests.[/quote]

This is the part that makes me the most excited. For instance, the quest I just completed (the vine quest) I designed so that I could run it in the future again, with the same premise but perhaps some alterations. If it was automated, the vine could keep telling people where to water its seeds, long after I am gone (even though I have no plans to leave currently, it's an eventuality.)

I thought about the issue of scripts and items, and you could create either the roll of the Garbage Man (who has access to all scripts, and deletes those seeming useless). That might give too much power to one person, so you could make a more automated version.

Since you seem to like the vote system, I suggest that for all those who are able to edit Clickable Items, there be a thumbs up, thumbs down next to the script. If the item stays negative for a set amount of time (a month seems reasonable, but I don't know), then the script will be deleted. This would also allow you to see relatively easily which player is the best coder, although PLEASE don't make a "Best Coder" tab like the Veteran and Most Popular tabs. For coding, it's better in my opinion if it remains anonymous.

Enjoy your vacation. :D


Link to post
Share on other sites

[quote name='Grido' date='28 October 2009 - 12:52 AM' timestamp='1256683959' post='45921']
i seem to recall that there used to be issues with a requirement on the ''uvars.name'' for LHO's (and RPC's, but that doesnt apply anymore) because the code didnt recognise the *'s but the persons name had the * in it, so whilst printing, because it's recalling would work fine, typing in an LHO's name wouldnt, because of the code. Is this sorted with the new codes?

If that makes [b][i]any[/i][/b] sense at all.

It was working in the past Grido. I had LHOs who tried and some won my quest.It was a simple trick: put / before the star like: /*Burns/*. It's the way to tell the code to interpret the character as a normal character not as a special one.

Awi:you realize that it's not a good idea with the thumbs up/down. A code is a code. It can be badly written but do amazing things or it can be extremely neat and do nothing except print your name. The quest is important here not the way it was written.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Forum Statistics

    Total Topics
    Total Posts

  • Recently Browsing

    No registered users viewing this page.

  • Upcoming Events

    No upcoming events found
  • Recent Event Reviews

  • Create New...