Results 1 to 3 of 3

Thread: need help makin a lua code 2 pge lua

  
  1. #1
    04005003 is offline -Hacks Newbie
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    10

    Default need help makin a lua code 2 pge lua

    its the clock out of lua player20 can someone help me got an idea
    ive also posted this on luaplayer but not getting any response


    background = Image.createEmpty(480, 272)
    clockOfs = 150
    clockWidth = 100
    clockTextPosition = 85
    clockBigMarkWidth = 7
    clockSmallMarkWidth = 3
    x0 = clockOfs
    y0 = clockOfs - clockWidth
    pi = 4*math.atan(1)
    color = Color.new(0, 255, 0)
    for i=0,60 do
    x1 = math.sin(pi-i/60*2*pi) * clockWidth + clockOfs
    y1 = math.cos(pi-i/60*2*pi) * clockWidth + clockOfs
    background:drawLine(x0, y0, x1, y1, color)
    xv = (x1 - clockOfs) / clockWidth
    yv = (y1 - clockOfs) / clockWidth
    if math.mod(i, 5) == 0 then
    xt = xv * clockTextPosition + clockOfs
    yt = yv * clockTextPosition + clockOfs
    value = math.ceil(i / 5)
    if value == 0 then
    value = 12
    end
    background:print(xt, yt, value, color)
    xv = xv * (clockWidth - clockBigMarkWidth) + clockOfs
    yv = yv * (clockWidth - clockBigMarkWidth) + clockOfs
    background:drawLine(x1, y1, xv, yv, color)
    else
    xv = xv * (clockWidth - clockSmallMarkWidth) + clockOfs
    yv = yv * (clockWidth - clockSmallMarkWidth) + clockOfs
    background:drawLine(x1, y1, xv, yv, color)
    end
    x0 = x1
    y0 = y1
    end
    background:print(4, 4, "os.date: ", color)
    background:print(4, 14, "digital: ", color)

    while not Controls.read():start() do
    screen:blit(0, 0, background, 0, 0, background:width(), background:height(), false)
    time = os.time()
    dateString = os.date("%c", time)
    screen:print(84, 4, dateString, color)
    dateFields = os.date("*t", time)
    hour = dateFields.hour
    if hour < 10 then
    hour = "0" .. hour
    end
    min = dateFields.min
    if min < 10 then
    min = "0" .. min
    end
    sec = dateFields.sec
    if sec < 10 then
    sec = "0" .. sec
    end
    screen:print(84, 14, hour .. ":" .. min .. ":" .. sec, color)

    hour = dateFields.hour
    if hour > 12 then
    hour = hour - 12
    end
    hour = hour + dateFields.min / 60 + dateFields.sec / 3600
    x = math.sin(pi-hour/12*2*pi) * clockWidth / 3 * 2 + clockOfs
    y = math.cos(pi-hour/12*2*pi) * clockWidth / 3 * 2 + clockOfs
    screen:drawLine(clockOfs, clockOfs, x, y, color)

    min = dateFields.min + dateFields.sec / 60
    x = math.sin(pi-min/60*2*pi) * clockWidth + clockOfs
    y = math.cos(pi-min/60*2*pi) * clockWidth + clockOfs
    screen:drawLine(clockOfs, clockOfs, x, y, color)

    x = math.sin(pi-dateFields.sec/60*2*pi) * clockWidth + clockOfs
    y = math.cos(pi-dateFields.sec/60*2*pi) * clockWidth + clockOfs
    screen:drawLine(clockOfs, clockOfs, x, y, color)

    screen.waitVblankStart()
    screen.flip()
    end


  2. #2
    10$man's Avatar
    10$man is offline Programmer -Hacks Smarty
    Join Date
    Jun 2010
    Posts
    100
    Rep Power
    8

    Default

    Hey! I AM GLAD SOMEONE IS FINALLY IN THIS SECTION!!
    srry
    What are you trying to ask?
    is there something wrong with your script or you wanna add to it or wat?
    My PSPz: PSP 2000 5.00 m33-4, PSP 1000 GEN d3

    Group Projects: Game (unannounced)

    personal Projects: Shotgun fun fun psp, Learning exploiting

  3. #3
    04005003 is offline -Hacks Newbie
    Join Date
    Sep 2008
    Posts
    34
    Rep Power
    10

    Post

    ive forgotten what i wanted it for
    ERM.......
    i think it was to try and get the round clock onto VLF LUA
    SOOOOO is that possible

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •