Crashed when run new script

Started by Rav3n_pl

Rav3n_pl Lv 1

Looks like something killing foldit:

code:
–local seed=recipe.GetRandomSeed() –NOT WORKING!!!
–calculate REALLY good seed
seed=math.abs(Score())os.time()
seed=seed%0.001
seed=1/seed
while seed<10000000 do seed=seed
1000 end
seed=seed-seed%1
p("Seed is: "..seed)
math.randomseed(seed)
–REALLY good seed made by rav3n_pl :P

output:

Seed is: -1.#IND

log:

Playing sound: 4
delta_score: 0
Playing sound: 4
Error removing old copy of file data
Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut9A12.tmp falling back to unsafe direct write of save data
Autosaved puzzles/0000993053/0000174969/helix3mer/autosave.ir_solution.
Error removing old copy of file data
Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut9A22.tmp falling back to unsafe direct write of save data
Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-best.ir_solution.
Error removing old copy of file data
Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut9A23.tmp falling back to unsafe direct write of save data
Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-recentbest.ir_solution.
Error removing old copy of file data
Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut9A34.tmp falling back to unsafe direct write of save data
Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-creditbest.ir_solution.
SRVR_THRD sending: 174969 993053 group_score
SRVR_THRD sending: 174969 993053 score
SRVR_THRD getting notifications…
SRVR_THRD sending play event log…

UNHANDLED EXCEPTION
1: library_main +913604 bytes (no line)
2: library_main +9744685 bytes (no line)
3: library_main +9755624 bytes (no line)
4: library_main +9744803 bytes (no line)
5: library_main +9745214 bytes (no line)
6: library_main +2795362 bytes (no line)
7: library_main +452563 bytes (no line)
8: library_main +2830579 bytes (no line)
9: library_main +2834043 bytes (no line)
10: BaseThreadInitThunk +18 bytes (no line)
11: RtlInitializeExceptionChain +99 bytes (no line)
12: RtlInitializeExceptionChain +54 bytes (no line)

Number too big exception or -1 passed to math.randomseed
It should be caught in lua, not kill client.

Rav3n_pl Lv 1

Well… no it is not this.
Changed code to
seed=os.time()/math.abs(Score())
seed is calculated properly now.
And it is crashing when "add dialog" is visible as current cation

ViewOptionsWidget::refresh() Error removing old copy of file data Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut2CE7.tmp falling back to unsafe direct write of save data Autosaved puzzles/0000993053/0000174969/helix3mer/autosave.ir_solution. Error removing old copy of file data Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut2CF8.tmp falling back to unsafe direct write of save data Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-best.ir_solution. Error removing old copy of file data Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut2D08.tmp falling back to unsafe direct write of save data Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-recentbest.ir_solution. Error removing old copy of file data Error creating temporary file puzzles/0000993053/0000174969/helix3mer\aut2D09.tmp falling back to unsafe direct write of save data Autosaved puzzles/0000993053/0000174969/helix3mer/autosave-creditbest.ir_solution. SRVR_THRD sending: 174969 993053 group_score SRVR_THRD sending: 174969 993053 score SRVR_THRD getting notifications... SRVR_THRD sending play event log...

UNHANDLED EXCEPTION
1: library_main +913604 bytes (no line)
2: library_main +9744685 bytes (no line)
3: library_main +9755624 bytes (no line)
4: library_main +9744803 bytes (no line)
5: library_main +9745214 bytes (no line)
6: library_main +2795362 bytes (no line)
7: library_main +452563 bytes (no line)
8: library_main +2830579 bytes (no line)
9: library_main +2834043 bytes (no line)
10: BaseThreadInitThunk +18 bytes (no line)
11: RtlInitializeExceptionChain +99 bytes (no line)
12: RtlInitializeExceptionChain +54 bytes (no line)

Rav3n_pl Lv 1

Ok, found it:

opt.gen = dialog.AddTextbox("Generations:", herd.maxgen)
vs
opt.gen = dialog.AddTextbox("Generations:", herd.maxGen)

herd.maxgen is null, herd.maxGen is boolean.

Dialog should catch it?