Jump to content

Rendril

Member
  • Posts

    612
  • Joined

  • Last visited

  • Days Won

    11

Posts posted by Rendril

  1. Master of Puppets(Joker) age 320 - current bid: 7 silver
    Pimped Grasan age 35 - current bid: 4 silver
    Pimped Grasan age 35 - current bid: 5 silver
    [s]Unholy Pope age 203[/s] sold

    Ages as of Year 5, Day 28

    Highest acceptable offers get the trade.
    PM/post your offers.

  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. 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)

  4. 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.

  5. 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]

  6. 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.

  7. 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.

  8. 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.

  9. [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]

  10. 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.

  11. 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.

  12. 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.

×
×
  • Create New...