Random Save Loader

  • FeynmanLogomaker
    6th Oct 2013 Member 0 Permalink

    I know it seems really simple, but it can actually be really interesting looking at such old saves.

     

    local function drawButton()
    tpt.drawrect(2, 373, 84, 10, 255, 255, 255, 255)
    if tpt.mousex >= 2 and tpt.mousey >= 374 and tpt.mousex <= 86 and tpt.mousey <= 383 then
    tpt.fillrect(2, 373, 84, 10, 255, 255, 255, 125)
    end
    tpt.drawtext(4, 375, 'Load random save', 0, 255, 0, 255)
    end
    tpt.register_step(drawButton)
    local function buttonMouseTest(x, y, b, e)
    if tpt.mousex >= 2 and tpt.mousey >= 374 and tpt.mousex <= 86 and tpt.mousey <= 383 and e == 2 then
    tpt.load(math.floor(math.random(1, 1333000))) -- 1333000: Fairly recent
    end
    end
    tpt.register_mouseclick(buttonMouseTest)

     

    Of course, it requires jacob1's mod, using tpt.load().

     

    ??????

    Edited once by FeynmanLogomaker. Last: 8th Oct 2013
  • jacob2
    6th Oct 2013 Member 0 Permalink
    Try similar.load, or better, try both depending on which is present. Progress on my mod us slow so I haven't done the new version yet with those lua functions

    Edit: luau
    Edited once by jacob1. Last: 6th Oct 2013
  • FeynmanLogomaker
    6th Oct 2013 Member 0 Permalink

    Wrong account, lol

  • KOTOM
    6th Oct 2013 Member 0 Permalink

    11: attempt to call field 'load' (a nil value)

  • xetalim
    6th Oct 2013 Member 0 Permalink
    @FeynmanLogomaker (View Post)
    no, not wrong account
  • jacob1
    6th Oct 2013 Developer 0 Permalink
    right account, I just don't login to tpt when i'm on my phone. So when I don't post some random weekend except for a few small "jacob2" posts, you know i'm somewhere without my computer or without internet.
  • FeynmanLogomaker
    6th Oct 2013 Member 0 Permalink

    KOTOM: Are you using jacob1's mod? (Just search it, it should be the first item to come up)

  • KOTOM
    7th Oct 2013 Member 0 Permalink

    @FeynmanLogomaker (View Post)

    No. With jacob1's mod 3\4 scripts which i using not working.

  • FeynmanLogomaker
    7th Oct 2013 Member 0 Permalink

    Oh. Well, this one is built around a function unique to jacob1's mod.

  • jacob1
    7th Oct 2013 Developer 0 Permalink
    @KOTOM (View Post)
    why not? It doesn't have the interface api, and I have seen a few scripts using that. If / When tpt multiplayer comes out, it won't use that api, and that's the main script I hope to completely support.

    I also don't have all the functions added in 88.1 because of laziness ... but the version after the next one will probably have them.

    My goal is to have the entire tpt++ api in there except for interface, if something doesn't work it's a bug in either my mod or in tpt. Can you tell me which scripts don't work?
    Edited once by jacob1. Last: 7th Oct 2013