Jump to content

Rendril

Member
  • Posts

    612
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Rendril

  1. Thanks for pointing out the change. When I tested it the function was case sensitive. Attritbutes are not required, I added the id only because the particular example I used needed a reference.
  2. [b]null[/b] mds_player_avatar(string $name, string $attributes); Will echo the player's avatar image if the name is valid, otherwise it will give a no avatar message. Player name is not case sensitive. The image is echoed directly by the function with only a null value returned. The function can be called a maximum of 5 times in the script. Attributes are not required, but if used will be given directly to the image in html. Example: HTML [code] <script type="text/javascript"> function toggle(){ var img = document.getElementById("avatar"); img.style.display = img.style.display == "none" ? "inline" : "none"; } </script> <input type="button" value="Show/Hide" onclick="toggle()" /> <br /> [/code] Script [code] echo @content[0]; mds_player_avatar('Rendril Revant', 'id="avatar"'); [/code]
  3. date('z') returns the numeric day of the year (starting from 0) I don't know of a php function that can show a server's age, but you can calculate MD's year: date("Y")-2005;
  4. Awiiya and I discussed this, for those interested in the code here it is: [code] <script type="text/javascript"> window.onload = function(){ document.getElementById("loader").style.display="none"; document.getElementById("content").style.display="block"; } </script> <div id="loader" style="text-align:center"> Loading...<br /> <img src="http://en9.tribalwars.net/graphic/throbber.gif" /> </div> <div id="content" style="display:none"> Your content etc <iframe src="etc etc">Your browser does not support iframes</iframe> </div> [/code] If the page loads fast enough, the preloader is not even seen. If you WANT it to be seen, add a setTimeout to the onload (I will add an example of this if someone would like it) For cool fade effects use a javascript library like jquery. Here's the setTimeout, change the <script> to reflect this:[code] <script type="text/javascript"> function loaded(){ document.getElementById("loader").style.display="none"; document.getElementById("content").style.display="block"; } window.onload = function(){ setTimeout ("loaded()", 4000); } </script>[/code] The 4000 is number of miliseconds to wait (4 seconds)
  5. To clarify, do you mean a preloader as in it loads data beforehand or preloader as in it looks like it is doing something while the user waits for everything to load, or both?
  6. Srbija igra u mom gradu, stadijum je 4km od kuce =D

  7. I like the idea of chosing who to allow to edit your papers. As requesting of someone to edit them for you, here you give them explicit access, thereby preventing someone from editing/removing your papers without consent. Maybe they could get your papers listed in addition to theirs under the papers window, thus they get the same interface but it will show only for you and without abuse.
  8. I was able to save the images without any difficulty. I realise now why the image must get used quickly. Thinking about its use, I see that it will need to be written as an image before the new icon function call, so instead can we be able to send more parameters to the image? It would be very useful to have id and class. So a function call like this mds_creature_icon(id, image_attributes); For example:[code] mds_creature_icon(12345, "id='image1' class='icon'");[/code]
  9. Yes, in fact it has been the site of many chases during HC.
  10. The same applies to many of my scripts, and clickables like the book of ancients, oak stories, hanging of mur etc. Having the option of making a clickable permanent would defeat the purpose of the auto-hide, who can justify their script being permanant without it having to be judged by Mur? I would rather have it auto-hide if the script's last use was 14 days ago, which in effect means nobody accessed in that time, of course "last use" needs to be more than merely viewing the clickable. I think allowing a cron to be implemented for each script would cause too much of a load on the server and be easily abuseable but perhaps scripts can get a global cron (hourly, maybe daily run?) that we can schedule to.
  11. How is this different to a normal auction? Those that can put forward the most money will of course win in the auction. It is not a flaw of the auction that you cannot afford bidding. I think it is a great initiative and should be savoured. That which possibly makes it seem unfair is the high prices the opening bids started at, this was of course a strategic move to eliminate opposition early on, but I feel it was too early too quickly. The minimum starting bid is 1 silver, I would have liked to see it start from that. I know this was a trial run, but I feel 3 items is too little, and they should be auctioned off sequentially rather than all at once. There are people who can pay ridiculous prices for the items, the question is if they are willing to do so. In my experience the objective of the bidder is to aim to spend as little as possible to gain as much as they can (unless of course if for example it is a fundraising auction) Having more items means those who want to spend extremely high prices, can do so, but it gives those who are unable or unwilling to spend extreme amount a chance compete. What I do see as a flaw of the auction is the variable valuation. In a noraml auction the difference between $1 and $10 is clear cut. Here it is a judgemental thing where every person values items differently, and it is not clear what the higher bid might be (not in all cases, but I do see a few) I would like to see the current accepted highest bid updated on ocasion so we know where it stands and can compare to previous bids so we get some indication as to what is considered more valuable.
  12. Rather than returning the image path, it could return the unique hash for the image and the coder can append it to make an image path. I think this would make the function more versatile. Script execution time is limited to 5 seconds (and memory use is limited too), even a badly coded script will not be able to run indefinitely. Perhaps limit the number of creature icons a script can gather in one session, like with avatars. 20 should be sufficient (1kb ?), pagination can be used when the coder needs more. If the concern is the memory waste from a bad script, consider the additional load from the workaround to manipulate the image as desired. For example, wraping the image in an invisible div given a custom id to be accessed through js, the upside is this would all be done client side. I admit the sample scripts I made are not optimal because I want them easier for a beginner to understand. In most scripts I use explicitly declared variables to make the desired functionaly apparent, rather than annoymous parameters even though it is more efficient, I will change this if needed. If you will keep it to echo the image, I suggest adding a transparent mask to prevent the image being saved easily. Allowing the coder to send an extra parameter for the image attributes as a string (id, class, style etc) would be useful too. Unfortuantely the save protection cannot be enforced if the function is changed to return only the unique hash.
  13. [b]null[/b] mds_creature_icon(int|string $id, string $attributes); Will echo an image icon of the creature matching the ID if it is valid otherwise it will give a missing creature message. The image is echoed directly by the function, there is only a null value returned. Since it is a direct echo rather than a string, your HTML code will need ot be wraped around it. The paramter sent is the creature ID, not the CTC. It can be found under the creature in the creature menu. Example: HTML[code] <form method="post" action=""> Enter CTC to see the creature's day of birth<br /> <input name="ctc" type="text" /><br /> <br /> <input name="submit" type="submit" value="Submit"/><br /> <br /> <font size="1px">*Copy from "CTC" to "MDC", not the entire code</font> </form> [/code] Script [code] echo @content[0]; //show the html if(isset(@input['submit']))//check that button was clicked { //get the creature data @vc= mds_is_ctc(@input['ctc']); //check whether ctc is va.lid if(@vc) { @vb = strtoupper("b");//i'm lazy //get birth timestamp @vt = @vc["date" . @vb . "orn"]; //print the day the creature was born echo "<hr />" . @vb . "orn on " . date("l", @vt) . "<br />"; //show creature icon mds_creature_icon(@vc['id'], "id='creature'"); echo "<hr />"; } else { echo "inva"."lid ctc supplied"; } } [/code]
  14. [quote name='phantasm' date='05 January 2010 - 08:07 PM' timestamp='1262714844' post='51917'] the only song types you can put into a embed file are mp3 files only [/quote] It depends on the browser and plugin support. I think midi, wav and mp3 are the default supported are.
  15. You are trying to play a YouTube (flv file), this is why I asked what type of file it was. YouTube has a small protection on their .flv's, so you need to add some more parameters. Change the width and height if you want the player to visible. [code] <embed width="0" height="0" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://www.youtube.com/v/UH4HDn4v24I&amp;feature=player_embedded&amp;fs=1&amp;autoplay=1"></embed> [/code] On a side note, YouTube provides the code in the "Embed" box to the right of the video, I haven't tested it but I assume it would work.
  16. Remember that the calendar shows a day at a time. I thnk it could have 3-5 events without looking cluttered. There would have to be 1500+ events just to get there.
  17. I woudl like to see MD-related dates in the calendar. Even if a land changes 10 kings in the next week, why not remmeber them? A simple noting of the event could be placed in the calendar, while full-length description would be located elsewhere, MD-archives, forum, clickables etc. Not every event needs to be noted, as Chewett said the problem lies in which events are to be selected. I think a public vote, or paying a wishpoint to add to the calendar would be suitable.
  18. What is the file type that you want to play? The below code should work for most, replace SONG_URL with your file's path, it should work in most browsers. [code]<embed src="SONG_URL.mp3" hidden="true" /> <noembed><bgsound src="SONG_URL.mp3" /></noembed>[/code]
  19. If the account was created long ago, it might have been deleted. Accounts inactive for more than 6 months were removed around last year July.
  20. It's inconsistent, but it should actually be ["tradevalue"], so ["tradev" . "alue"] ought to work. Age and tradevalue are the only fields that are of type float (numbers with decimals), since the age displays correctly, it is not a type conversion error. My guess is that the trade value for creatures traded prior to the trade value implementation, will be 0, perhaps until traded. Are you trying it with an old creature that was traded? If so, try it with a new creature that gets traded and see if the same thing happens.
  21. There is a lot of potential for abuse with this, I will not disclose it here lest it becomes widespread.
  22. There was an increase to the score required for stage 2 to start, the duration of the stage was increased as well (to 48 hours)
  23. It's due to the way the indexes are named. MD script turns all your text to lowercase, so when you have ["battlesWon"], the script reads ["battleswon"] (lower case) To solve this use any method of your choosing to uppercase the letter. You will find that indexes which didn't work were the ones with uppercase letters. The lowercasing is a hassle, but was added for security. It will possibly be remvoed in future. Edit: [quote name='Burns' date='01 January 2010 - 12:29 PM' timestamp='1262341765' post='51581'] okay, solved that so far... but tradevalue, even written as 'trade'.[b]strtolower[/b](v).'alue' always gives me a 0 as result so far... and i dearly hope that getting a 0 out of it is not my fault again :/ [/quote] Try use strtoupper() insread of strtolower()
  24. Mur was informed of this quite a while ago. It should only be a small check to add.
  25. I'm in favour of all over Cutler's suggestions. [quote name='cutler121'] 2) Keep track of quest progress by having MDscript send a PM when a quest leg is completed. [/quote] A mail() function would be great, perhaps limit it so that it can only mail the scripter, rather than giving the ability to mail anyone. [quote name='cutler121'] 3) Give and take items from within MDscript (mainly I am thinking about silver coins) to help implement a more robust MD economy. (But WP and other items would be nice as well) [/quote] I brought this up a while ago for both item and creature transfers. I would love a function that can do it. The question is how to prevent abuse, whether it is an intended abuse or not.
×
×
  • Create New...