Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; How would I open a file with a number, then subtract a number from the origianol number or add to ...
-
10-12-2006, 02:36 PM #3631QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
How would I open a file with a number, then subtract a number from the origianol number or add to the number?
like if some one gets aquestion right, lua opens the file then add to the number that is in the text document.
-
10-12-2006, 02:48 PM #3632Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von the undead
Code:file = io.open("testRead.txt","r") score = file:read() -- will read line 1 of the file -- file:close() file = io.open("testRead.txt","w") if (question is right) then score = score + 1 file:write(score) end -- at the end of code -- file:close()--------------------------------------------------------------------------------------
-
10-12-2006, 02:51 PM #3633QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Ok thanks ill tell you if it works
-
10-12-2006, 02:52 PM #3634QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
No, but there is a memory limit of 8mb as you just said. As images are loaded to memory, they are loaded in as a RAW format (think BMP). The fact the images as .jpgs/.pngs in total are less then 2mb is irrelevant, it's the size of the images in memory is what counts here.
Zitat von Fuzzie360
-
10-12-2006, 02:56 PM #3635QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Thanks it works!
-
10-12-2006, 03:00 PM #3636Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
no prob. i actually though it wouldnt work, but meh. ;)
Zitat von the undead
--------------------------------------------------------------------------------------
-
10-12-2006, 06:24 PM #3637QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Ok, now I need to lnow how to open two files read one. close it then write that to the other file
-
10-12-2006, 06:35 PM #3638I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
You should learn how to do some things by yourself. Check out this tutorial.

-
10-12-2006, 06:38 PM #3639QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
I know about that tut ive been reading it , ive been teaching myself this stuff, I wouldnt have asked if I found it.....
Zitat von ARza
-
10-12-2006, 07:04 PM #3640Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von the undead
simple. same concept, just two files.
Code:file1 = io.open("name1.txt", "r") data = file1:read() file1:close() file2 = io.open("name2.txt", "w") file2:write(data) file2:close()--------------------------------------------------------------------------------------
-
10-12-2006, 07:37 PM #3641QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
is there a way to make a counter go in seconds not milseconds any help would be great
-
10-12-2006, 07:53 PM #3642Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von rowanmcau
well, there are 1000 milliseconds in a second so:
Code:timer = Timer.new() timer:start() while true do seconds = math.floor(timer:time()/1000) screen:print(5,5,"seconds ="..seconds, color) screen.waitVblankStart() screen:flip() end
you just take the time and divide it by 1000 and round it down to an int. (otherwise it will say like: seconds = 1.3456 etc.)
BTW, math.floor rounds a number down. so 1.3456 will become 1, until 1.3456 goes up to above 2. then it will be 2.--------------------------------------------------------------------------------------
-
10-12-2006, 09:45 PM #3643QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
thx it was the math.floor part i needed i worked out the divide part
-= Double Post =-
what would be good colision code if i want to know when the two images(same size) over lap i don't want them to need to be exactly overlaping i'm making a game that u shoot stuffGeändert von mafia1ft (10-12-2006 um 09:45 PM Uhr) Grund: Automerged Doublepost
-
10-12-2006, 10:57 PM #3644words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Theres plenty of collision mech's out there. I remember i ported a C collision mech to LUA... search for a thread called collison...

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
10-12-2006, 11:40 PM #3645QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
i had a look at that code it's not what i'm looking for thats for walking in to walls and stuff. what i'm looking for is a way of saying "if middle of picture1 is touching any of picture2 then ..."
both pictures are "20 high" and "31 wide"
-
10-13-2006, 02:55 AM #3646QJ Gamer Bronze
- Registriert seit
- Feb 2006
- Ort
- Earth, UK
- Beiträge
- 457
- Points
- 5.924
- Level
- 49
- Downloads
- 0
- Uploads
- 0
try this
That should work if you also have the code to move pic[1].x and pic[1].y around.Code:Pic={} pic[1]={pic=Image.load("picture1.png"),x=0,y=0,midx=pic[1].x+15,midy=pic[1].y+10} pic[2]{pic=Image.load("picture2.png"),x=180,y=100,farx=pic[2].x+31,fary=pic[2].y+20} --in main loop if pic[1].midx>=pic[2].x and pic[1].midx<=pic[2].farx then if pic[1].midy>=pic[2].y and pic[1].midx<=pic[2].fary then screen:print(0,0,"Found you",blue) end end
If it still doesnt work then i did something wrong...Geändert von JoeDaStudd (10-13-2006 um 06:02 AM Uhr)
<<Put A message Here>>
<<Just made another rubbish website visit it here.>>
-
10-13-2006, 04:21 AM #3647QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
error:main.lua:8: attempt to index global "duck" (a nil value)
line 8: duck[1]={pic=Image.load("pics/duck_1.png"),x=25,y=53,fa rx=duck[1].x+31,fary=duck[1].y+20}
what did i do wrong
EDIT:
fixed that error
now this one
error:main.lua:8: attempt to index field "?" (a nil value)
line 8 hasn't change from aboveGeändert von mafia1ft (10-13-2006 um 04:33 AM Uhr)
-
10-13-2006, 04:45 AM #3648QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- London, United Kingdom
- Beiträge
- 131
- Points
- 4.812
- Level
- 44
- Downloads
- 0
- Uploads
- 0
screen.waitVblankStart()
Am I right in thinking thats keeping the image refreshing in sync with the PSPs refreshrate? Like VSync for the pc. If so, Why would anyone care about tearing on a PSP?
Ive read that its keeps the image on screen but thats screen.flip() right?
Removing screen.waitVblankStart() from my program, I saw no differences except for a healthy performance boost. Just like disabling VSync on the pc.
-
10-13-2006, 06:01 AM #3649QJ Gamer Bronze
- Registriert seit
- Feb 2006
- Ort
- Earth, UK
- Beiträge
- 457
- Points
- 5.924
- Level
- 49
- Downloads
- 0
- Uploads
- 0
ok remove the farx and far y from the duck[1] {}
and add them below
so it looks something like this
Code:duck[1]={pic=Image.load("pics/duck_1.png"),x=25,y=53} farx=duck[1].x+31 fary=duck[1].y+20<<Put A message Here>>
<<Just made another rubbish website visit it here.>>
-
10-13-2006, 06:14 AM #3650QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
ok that fixed that error now i get this 1
Error: main.lua:86: bad argument #2 to 'blit' (image expected, got table)
line 86: screen:blit(duck[1].x, duck[1].y, duck[1])
edit fixed that
now when i click x i get
Error: main.lua:167: attempt to compare number with nil
-
10-13-2006, 06:19 AM #3651QJ Gamer Bronze
- Registriert seit
- Feb 2006
- Ort
- Earth, UK
- Beiträge
- 457
- Points
- 5.924
- Level
- 49
- Downloads
- 0
- Uploads
- 0
this line
doesnt include a pic is and is what caused that error.Code:screen:blit(duck[1].x, duck[1].y, duck[1])
duck[1] is the name of the table which you are telling it to blit (print to screen as a pic)
I think you just forgot to write
duck[1].pic
so that line would be
Ps. soz for the number of edits ive done to this postCode:screen:blit(duck[1].x, duck[1].y, duck[1].pic)
<<Put A message Here>>
<<Just made another rubbish website visit it here.>>
-
10-13-2006, 06:27 AM #3652QJ Gamer Green
- Registriert seit
- Feb 2006
- Ort
- Australia - A.C.T.
- Beiträge
- 1.517
- Points
- 9.253
- Level
- 64
- Downloads
- 0
- Uploads
- 0
it's cool btw i'm putting u in the credits for all your help
fixed that
now when i click x i get
Error: main.lua:167: attempt to compare number with nil
-
10-13-2006, 06:48 AM #3653QJ Gamer Bronze
- Registriert seit
- Feb 2006
- Ort
- Earth, UK
- Beiträge
- 457
- Points
- 5.924
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Thanks
Zitat von rowanmcau
What code is on line 167?
EDIT; if you what I can take a quick look at the code for you if u attach it, that way i can sort out most of the problems in one go<<Put A message Here>>
<<Just made another rubbish website visit it here.>>
-
10-13-2006, 07:21 AM #3654QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
omg im still learning lua! :/
Zitat von Grimfate126
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
10-13-2006, 08:53 AM #3655I love the PS3!!!
- Registriert seit
- Nov 2005
- Ort
- Look behind you
- Beiträge
- 1.876
- Points
- 11.447
- Level
- 70
- Downloads
- 0
- Uploads
- 0
is there a script/function to tell of the variable is odd or even? i need this:
if variable is odd then do this, if not do this.[size=-3][color=#fefefe]11[/color][color=white]0[/color][color=#fbfbfb]1[/color][color=#f1f4f6]0[/color][color=#f2f5f8]0[/color][color=#f7f8fa]1[/color][color=#fcfcfc]0[/color][color=#fdfefd]0[/color][color=#fffffe]1[/color][color=#fefefe]1[/color][color=white]1[/color][color=#fefefe]000[/color][color=white]1[/color][color=#fefefe]0[/color][color=white]0[/color][color=#fefefe]1111011[/color][color=white]1[/color][color=#fefefe]1[/color][color=white]101[/color]
[color=white]1[/color][color=#fffefe]0[/color][color=#cad3e0]0[/color][color=#6f7f9c]1[/color][color=#788eaf]0[/color][color=#98b7d6]0[/color][color=#99c0e1]0[/color][color=#9ac2e2]1[/color][color=#a5c6e2]1[/color][color=#a6c3e2]0[/color][color=#b2bed1]1[/color][color=#dbe2ed]0[/color][color=#f7f9fa]1[/color][color=#fefefd]10110[/color][color=#fefefe]01[/color][color=#fefefd]0[/color][color=#fefefe]1[/color][color=#fefefd]10[/color][color=#fefefe]1[/color][color=white]00100[/color]
[color=#fefefe]0[/color][color=#f2f6f8]0[/color][color=#566da3]0[/color][color=#8a919d]1[/color][color=#e2e5e4]0[/color][color=#eff2f3]0[/color][color=#eef2f6]1[/color][color=#e8eef3]1[/color][color=#dfe6ee]1[/color][color=#d1dee8]0[/color][color=#c1cddd]1[/color][color=#7997ce]1[/color][color=#8ea4d1]1[/color][color=#ebeeee]0[/color][color=#fdfef9]0[/color][color=#fefffa]1[/color][color=#fefefc]01101011[/color][color=#fefefd]1[/color][color=#fefefe]00[/color][color=white]10[/color][color=#fefefe]1[/color]
[color=#fefefe]1[/color][color=#dde3ef]0[/color][color=#4866a7]1[/color][color=#b3bbc6]0[/color][color=#fafbf7]1[/color][color=#fefefc]0[/color][color=#f6f7f9]0[/color][color=#a8b6cf]1[/color][color=#6a7c9b]0[/color][color=#6886b2]0[/color][color=#7697c8]0[/color][color=#85a3cd]1[/color][color=#6287c3]1[/color][color=#496eb6]1[/color][color=#98abce]0[/color][color=#dde5e5]1[/color][color=#fcfef4]0[/color][color=#fdfef7]1[/color][color=#fefffa]100[/color][color=#fefefb]00[/color][color=#fefefc]00[/color][color=#fefefd]1[/color][color=#fefefe]1[/color][color=white]0[/color][color=#fefefe]0[/color][color=white]1[/color]
[color=#fefefd]0[/color][color=#f8fafa]0[/color][color=#a7bce4]1[/color][color=#6887cf]0[/color][color=#9eb0d3]1[/color][color=#e3e9ec]1[/color][color=#bbc4d6]0[/color][color=#405b99]1[/color][color=#848b97]0[/color][color=#c2cace]0[/color][color=#c2cdd7]1[/color][color=#bdcce0]0[/color][color=#94acd4]1[/color][color=#547dc3]1[/color][color=#385ea9]1[/color][color=#496eb1]1[/color][color=#90a7c7]1[/color][color=#dde4e4]1[/color][color=#f6f9ee]1[/color][color=#fcfef3]1[/color][color=#fdfff5]1[/color][color=#fdfef7]1[/color][color=#fdfef8]0[/color][color=#fdfef9]1[/color][color=#fefefa]1[/color][color=#fefffb]1[/color][color=#fefefb]0[/color][color=#fefefc]1[/color][color=#fefefe]11[/color]
[color=#fefefc]01[/color][color=#fcfdfc]0[/color][color=#e6ecf7]0[/color][color=#9fb5e7]0[/color][color=#6889cf]0[/color][color=#6b86c0]1[/color][color=#415ba1]0[/color][color=#6c82b0]0[/color][color=#d4d9da]0[/color][color=#f4f6ec]0[/color][color=#f8faf1]1[/color][color=#f5f8f3]0[/color][color=#e0e7ec]1[/color][color=#a0b7d8]1[/color][color=#5e82c2]0[/color][color=#2e5fb4]0[/color][color=#4065b0]1[/color][color=#809cc5]1[/color][color=#cdd7d9]1[/color][color=#f7f9e9]0[/color][color=#fafcef]1[/color][color=#fcfef2]1[/color][color=#fdfef5]1[/color][color=#fdfef6]1[/color][color=#fdfef9]0[/color][color=#fefff9]1[/color][color=#fefffa]1[/color][color=#fefefc]10[/color]
[color=#fefefc]1100[/color][color=#fbfcfc]1[/color][color=#e8eff7]1[/color][color=#a5b8e6]1[/color][color=#5a7cc9]1[/color][color=#3a589d]0[/color][color=#3c5ba2]1[/color][color=#8d9fc1]1[/color][color=#d8deda]0[/color][color=#f4f7e8]0[/color][color=#f5f8ec]1[/color][color=#f1f5ea]0[/color][color=#dee5e4]1[/color][color=#b1c2d5]0[/color][color=#6b8dc7]1[/color][color=#416dba]1[/color][color=#3965b2]0[/color][color=#6c88b8]1[/color][color=#b5c3cd]0[/color][color=#e4e8df]1[/color][color=#f7f8e8]0[/color][color=#fbfdef]1[/color][color=#fcfef4]0[/color][color=#fdfff7]1[/color][color=#fefffa]0[/color][color=#fefefb]0[/color][color=#fefefc]1[/color]
[color=#fefffb]1[/color][color=#fefefb]1[/color][color=#fefefc]0[/color][color=#fefffb]10[/color][color=#fdfefa]1[/color][color=#f9fbf9]0[/color][color=#dce4f1]1[/color][color=#94aada]1[/color][color=#4567b4]0[/color][color=#2c509f]0[/color][color=#4c6bac]0[/color][color=#a0adc3]1[/color][color=#e3e6db]0[/color][color=#f0f2e2]1[/color][color=#f0f3e4]0[/color][color=#ecf0e3]0[/color][color=#dde1dd]0[/color][color=#b1bfd1]0[/color][color=#7893bf]0[/color][color=#416fb7]0[/color][color=#3c66ad]0[/color][color=#6181b8]1[/color][color=#a3b2c8]1[/color][color=#dfe4de]1[/color][color=#f1f3e6]0[/color][color=#fafbf0]0[/color][color=#fcfdf6]1[/color][color=#fdfff8]1[/color][color=#fefffa]0[/color]
[color=#fefffa]10[/color][color=#fefefa]1[/color][color=#fefffa]1[/color][color=#fefff9]11[/color][color=#fdfef8]1[/color][color=#fcfdf4]0[/color][color=#f5f7f3]0[/color][color=#d6dee9]1[/color][color=#809ad5]0[/color][color=#3a5cad]1[/color][color=#264a9f]1[/color][color=#4e6aad]1[/color][color=#a8b3c5]1[/color][color=#e2e4d5]1[/color][color=#ebecda]1[/color][color=#edeee0]0[/color][color=#e9ebde]0[/color][color=#dee1db]1[/color][color=#bfc7cd]1[/color][color=#869ec2]1[/color][color=#5479ba]1[/color][color=#3665b4]1[/color][color=#466aaf]0[/color][color=#7f95b9]1[/color][color=#c5ccd0]1[/color][color=#f2f3e6]0[/color][color=#f9faef]1[/color][color=#fcfef4]0[/color]
[color=#fdfef7]10110[/color][color=#fdfef5]1[/color][color=#fdfdf2]1[/color][color=#fbfdf1]0[/color][color=#fbfcf0]0[/color][color=#f6f8ec]0[/color][color=#eaece8]0[/color][color=#c0cbdc]1[/color][color=#6e88c5]1[/color][color=#3657ab]0[/color][color=#2d4ea1]1[/color][color=#5b73ac]1[/color][color=#b1b9c1]1[/color][color=#dbdccf]0[/color][color=#e5e6d4]0[/color][color=#e6e7d7]0[/color][color=#e4e5da]0[/color][color=#d9ddd5]1[/color][color=#c1caca]0[/color][color=#99a9be]1[/color][color=#6584b9]1[/color][color=#4369b1]0[/color][color=#3f5fa1]0[/color][color=#7586a6]0[/color][color=#dcddd0]1[/color][color=#f4f4e7]1[/color]
[color=#fcfdf1]01[/color][color=#fcfcf0]1[/color][color=#fcfcef]1[/color][color=#fcfcf0]1[/color][color=#fcfcef]0[/color][color=#fbfced]0[/color][color=#f9fbeb]1[/color][color=#f9faea]1[/color][color=#f7f8e7]0[/color][color=#f3f4e6]1[/color][color=#eeeee2]1[/color][color=#dbdfdb]0[/color][color=#a4b1ca]1[/color][color=#5670b4]1[/color][color=#284ca4]1[/color][color=#2e4e9a]0[/color][color=#6d80aa]1[/color][color=#bcc0bb]0[/color][color=#d9dbc9]1[/color][color=#dfe0ce]0[/color][color=#e2e3d2]0[/color][color=#dfe1d2]1[/color][color=#d7dbd0]1[/color][color=#c4cbc9]1[/color][color=#96a2b6]0[/color][color=#3c558e]0[/color][color=#56637f]0[/color][color=#d0d2c2]0[/color][color=#eae9db]0[/color]
[color=#fafbec]1[/color][color=#f9faea]1000[/color][color=#f8f8e8]0[/color][color=#f7f7e6]1[/color][color=#f5f7e5]0[/color][color=#f5f5e3]0[/color][color=#f3f3e1]1[/color][color=#f1f1dd]0[/color][color=#eeeedc]0[/color][color=#ececda]0[/color][color=#e3e4d4]0[/color][color=#ced0c9]0[/color][color=#8e9db9]1[/color][color=#4766ac]0[/color][color=#234799]0[/color][color=#2e4c96]0[/color][color=#727d93]1[/color][color=#c1c2b1]0[/color][color=#d0d2c0]0[/color][color=#c1c6c1]1[/color][color=#9ba3b1]0[/color][color=#677591]0[/color][color=#415179]1[/color][color=#515d75]1[/color][color=#9fa29b]0[/color][color=#dbdacc]0[/color][color=#eceadb]0[/color]
[color=#f6f5e5]10[/color][color=#f5f4e4]1[/color][color=#f5f5e3]01[/color][color=#f3f3e1]0[/color][color=#f3f2de]1[/color][color=#f2f1e0]0[/color][color=#f0efdc]0[/color][color=#efeed9]0[/color][color=#edecd8]0[/color][color=#ebebd6]1[/color][color=#e8e8d2]1[/color][color=#e3e2cd]0[/color][color=#e0dfcb]1[/color][color=#d6d6c6]1[/color][color=#b7bcbf]0[/color][color=#7a8cb0]1[/color][color=#4564a7]0[/color][color=#354d81]1[/color][color=#616b7f]0[/color][color=#57657f]1[/color][color=#445371]1[/color][color=#4f586b]1[/color][color=#6f7478]0[/color][color=#999b93]0[/color][color=#bdbeb0]1[/color][color=#d7d6c6]0[/color][color=#e5e3d3]1[/color][color=#eae9d8]0[/color]
[color=#f1f0dd]0[/color][color=#f1efdc]0[/color][color=#f1f0e0]1[/color][color=#f0efdc]0[/color][color=#f0f0db]1[/color][color=#f0efd9]1[/color][color=#eeedd8]1[/color][color=#ededd7]1[/color][color=#ebebd4]0[/color][color=#eae9d3]0[/color][color=#e8e7d2]1[/color][color=#e6e6cf]0[/color][color=#e4e4cc]1[/color][color=#e2e2ca]1[/color][color=#e0dfca]0[/color][color=#dddcc6]0[/color][color=#d7d8c3]0[/color][color=#cdcfbd]1[/color][color=#adb1ac]1[/color][color=#868f95]1[/color][color=#777e7f]1[/color][color=#82867f]1[/color][color=#9d9e8f]1[/color][color=#b7b6a2]0[/color][color=#c6c6b0]1[/color][color=#d0d0ba]1[/color][color=#d7d6c3]0[/color][color=#dddcc9]0[/color][color=#e2e1ce]1[/color][color=#e5e4d1]0
[/color][/size]
[SIZE=1]a paper clip made by thekon[/SIZE]
-
10-13-2006, 08:56 AM #3656QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Code:if 1 == math.mod(Number, 2) then -- number is odd else -- number is even end
-
10-13-2006, 01:18 PM #3657Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Zitat von myschoo
so am i. so is shine. so is pspmillionaire. so is bill gates (im guessing.) thats not good enough of an excuse to not try something by yourself. i wasn't flaming you. just because one way works, doesnt mean thats the best way.
believe me, im still like that sometimes, so i have no right to talk to you like i never do it, but im trying my best to quit that habit, and so should everyone.--------------------------------------------------------------------------------------
-
10-13-2006, 02:17 PM #3658QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0
Didnt work, so I tryed altering it but still dosent work..here is what I did
Zitat von Grimfate126
Code:file = io.open("score.txt", "r") score = file:read() file:close() file:close() file = io.open("Hscore.txt", "r") H = file:read() file:close() file = io.open("Hscore.txt", "w") if score >= H then H = file:write(score) end file:close()
-
10-13-2006, 06:34 PM #3659Developer

- Registriert seit
- Jul 2006
- Beiträge
- 205
- Points
- 4.318
- Level
- 41
- Downloads
- 0
- Uploads
- 0
What doesn't work about it? You have two file:close() lines in there, did it give you an error for that? Also, if you're reading a number, you might have to use file:read("*n"). That's all I can see wrong with it.
-
10-13-2006, 06:43 PM #3660QJ Gamer Blue
- Registriert seit
- Sep 2006
- Ort
- 6ft. Down Underground........Oh and guess what my avatar is
- Beiträge
- 387
- Points
- 4.918
- Level
- 44
- Downloads
- 0
- Uploads
- 0


LinkBack URL
About LinkBacks
Mit Zitat antworten
)

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum