--- < ~~~~~ > --- < \./~ > --- < I > --[===========[ @title scriptiX.Lua @chdk_version 1.4 --- Speichermangel bei Ix230HS, [SX210is: NICHT MEHR MIT-1.5.0-5163] --- (D,E,2,9,1,-2,F,0,0,0,C,A,Z,G,1,88 --(D,E,H,T,P, L,F,R,I,J,C,A,Z,G,W,U) @param D D Startordner @default D 0 @values D SCRIPTS LOGS BOOKS HELP (.scX) @param E E Endung @default E 0 @values E .Lua .bAs >>.tXt .baK .tmp .lOg .scX .XxX @param H H Helfix @default H 0 @values H --- HELP/ LOGS/ SCRIPTS/ BOOKS/ german ??? @param T T Trix & Errorix @default T 0 @values T --- ??? @param P P process +ab|0>_|-letzte @default P 1 @param L L edit Zeile xxx>_ (!-=^^=!) @default L 0 @param F Find_str [find[><: WOODTXT #^^%q%q @param R R --- /rem Zeilen? @default R 2 @values R KEEP -cut- >Parse @param I I *?* Insertix @default I 0 @values I nein JA @subtitle :...,....1....,....2....,....3....,....4.. @param J J Layoutix? @default J 0 @values J nein JA @param C C Kürzen (!-=RO=-!) @default C 0 @param A Ab Zeile (|0=noNr|-noEd) @default A 1 @param Z bis Zeile (|0=crLf|-letzte) @default Z 99999 @param G G LOG_~.TXT (|0=gec|+Neu|-Anh) @default G 0 @param W W Laufzeitbremse (-1=noEcho) @default W 4 @subtitle DON'T PANIC! @param U U {}@ (|0 bei lowMem) @default U 1 --]===========] --[ [--:) [PC] z.B. wenn man scriptiX selbst oder extern (scryptiX) starten möchte. _HLP if not sleep then _HLP=O==O; function compat() function get_exp_count(...) return ... or 9999 end function get_tick_count(...) return ... or 0 end function get_image_dir(...) return ... or "" end function console_redraw(...) return ... end function set_console_layout(...) return ... end function file_browser(s,...) print (">Startup dir:<", s,...); io.stdout:flush() return io.stdin:read() or "" end function play_sound(...) return ... or 4 end function sleep(...) return ... end function is_pressed(...) return nil end function wait_click(...) return ... or 9999 end function textbox( t, m, d, l) --line 825 print (">Title:<", t) if t and m and not t:find(m,1,1) then print (">Message:<", m) end if d and m and (m~=cut(d)) then print (">Default string<", d) end local res = d; io.stdout:flush() res=d or io.stdin:read() return res or "" end -- if not unpack then function unpack(t)--Lua 5.3 -- return table.unpack(t) end end print(_VERSION,compat) end compat() end--]]-- --- : --print_screen(-112) --function restore(x) return x end function help(...) local x=0 if G<21 then for ee,lin in pairs(_G) do x=x+1 if G*G<111 then if G*G%2==0 then golog(ee) else golog(stf([[%s %q]],ee,lin)) end end print(x,-collectgarbage("count"),ee,lin) wait(0) end if G/2==-3 then return 0 end end --[ [-- repeat local str=... local l,K,x=t,0,0 collectgarbage() if str==nil then str="X" end if str=="" then str="L" end local hfile="A/CHDK/HELP/"..str if #str==1 then hfile=getstr("ß",str) end for lin in io.lines(hfile) do x=x+1 if lin:find(find_str)~=nil then K=0; l=t end local ii=1; wait(1) while lin~="" do if K==8 then return x end for i=1,ii do str=lin; print(-x,str) if K~=8 then K=0 end l=l+1+#str/44 while l>11 and K==0 do l=1; K,ti=getkey(4) if K==2 then l=t str=edlin(str); Go=golog(str) if lstr(4,str)==" " then K=0 end end if K>22 or K==6 then l=t end while K==29 do K=0 if ti>t then prompt(0,str) elseif ti>333 then prompt(42,str) end Go=golog(str); ti=0 end if ti>555 then return x end end end --ii lin="" end -- wh lin end --io K=getkey(5) --,collectgarbage("count"),err) collectgarbage() until K~=5 --]]-- return x end function golog(...) --local f,r=... --if r~=nil and isfile(f) then return output(f,r) end local l=get_exp_count() if G~=0 then l=G end if G>0 then Glog=stf("A/CHDK/LOGS/LOG_%04d.TXT",G); G=-G end if _HLP or G*G<111 or type(...)=="table" then output(12,...) else print_screen(l) set_console_autoredraw(-1) print(...) set_console_autoredraw(1) print_screen(0) end return l end function img_info(x,...) local str,dd="",get_image_dir() if x>=1 then if ... then print(...) end print(os.date()); K=5 end if x==t then str=file_browser(dd) or "" end if str=="" then str=printf("%s/IMG_%04d.JPG",dd,get_exp_count()) end return str,dd.."/" end function klix(x,...) collectgarbage() --[ [--:)<1 then --shoot(); file_browser(mdI) else repeat set_aelock(0); set_aflock(0) press("shoot_half"); sleep(42) while get_shooting() do sleep(42) end repeat iii=get_free_disk_space() until not get_shooting() and not is_pressed("shoot_half") set_aflock(1); set_aelock(1) press("shoot_full") play_sound(1) release("shoot_full") if (get_tv96()<1) and (get_raw_nr()~=1) then sleep(tv96_to_usec(get_tv96())/t) end--Zeit f. Darkframe, -- rettet Ixus300HS Kamerafehler E26 ?? --kkk or u==7 iii=kkk end --u release("shoot_half") until not is_pressed("shoot_half") end repeat K=getkey(x*t+9); wait(0) if K==8 or x>0 then local i=img_info(1,...) if #str>1 then output(1,str) end output(1,stf("%s\n %s",i,os.date())) if lstr(1,str)=="?" then output(1,textbox(basline,...," Motiv:",t) or " cat!") end str='' end if x==t then return kkk else x=x%10 end if K==5 then K=exitalt(5,"*") end --x==1 notiert jedes Bild,10 nur das 1. until K~=9 until K~=29 --]]-- return K end function exitalt(x,...) play_sound(x,"exitalt"); local K=getkey(t); if K==0 then set_aelock(0); set_aflock(0) end repeat exit_alt(); sleep(333) until get_alt_mode(); K=getkey(t); K=getkey(5,...); pau=t return K end function wait(w) if _HLP or (W<0) then return 0 end if not get_alt_mode() then exitalt(0,"exitalt wait") end wait_click(w*100+1,"wait") w=get_tick_count() repeat wait_click(10) until not is_pressed "right" w=(get_tick_count()-w)/100 if w>2 and w<22 then W=w end if w>40 then pau=t end if is_pressed "down" then sleep(199) collectgarbage() if (W>0) and (Li>0) then W=W-1 end end return w end function lstr(x,...) --if type(...)~="string" then error([[ EYn ^VV^ildsch^vv^eYn! ]],2) end if x<0 then x=x-1 end return string.sub(...,1,x) end function rstr(x,...) if x<0 then x=string.len(...)+x end return string.sub(...,-x,t) end function printf(...) local str=string.format(...) print(str) return str end function stf(...) local s,r=... if r and string.find(s,"%",1,1) then return assert(string.format(setarg(...)),...) end return ... end function cut(...) if not ... then return "\t" end local x,str=0,tostring(...) repeat x=x+1 until x>=#str or str:sub(x,x)>"\30" str=str:sub(x,t) str=str:gsub("\t"," ") -- while str:find(" ") do str=str:gsub(" "," ") end return str end function split(sep,str,...) str=tostring(str) if type(sep)=="number" then return lstr(sep,str),rstr(-sep,str),#str-sep end local spc=sep==" " local x=str:find(sep,...) if spc then str=cut(str) end if x==nil then sep="" else sep=str:sub(x+#sep,t); str=str:sub(1,x-1) end if x==1 and spc then str=sep end return str,sep,str:find(sep,...) or 0 end function tonum(x,...) local p,chr,str=0,'',... if x==nil then tonumber() end if type(x)~="number" then if x=="" then return end str=x; x=1 end if type(str)=="boolean" then if str==x==x then return 1,1 else return 0,1 end end if str==nil then return nil,-t end if type(str)=="table" then return #str or -1,str[x] end if x*x>#str*#str then return 0,-#str end repeat chr=str:sub(x,x) if tonumber(chr)~=nil then if p==0 then p=x end else if p>0 then str=str:sub(p,x-1); chr=lstr(p-1,...) end end x=x+1 until x>#str if x+10 then return x end return -x end --]]-- function setarg(...) if ...==nil then arg=nil return collectgarbage("count") end local X,sep,x,s=0,seP or ',',... if type(x)=="boolean" then if s==nil then if x==x==x then table.concat(arg,sep) else table.sort(arg) end return unpack(arg) end if x==x==x then if type(s)=="boolean" then repeat X=X+1 if arg[X]~=nil then if s==x==x then newline(t,arg[X]); writeln(arg[X]) else print(arg[X]) end end until X>=#arg return unpack(arg) end if type(s)=="table" then return unpack(s) or s else arg={...} end end end if isfile(x) then arg={} for z in io.lines(x) do X=X+1; arg[X]=z end collectgarbage(); return unpack(arg) end if arg==nil then arg={...} end local arg={} if type(x)~="table" then arg={...} else repeat getkey(1,x[1]) if x[1]==nil then--x==_G then for ee,lin in pairs(x) do X=X+1 if G*G%2==0 then arg[X]=ee else arg[X]=(stf([[%s%s%s]],ee,s or seP or ',',lin)) end end table.sort(arg) if s then output(13,arg) return unpack(arg) end end if s==nil then return unpack(x) else if type(s)=="table" then return unpack(x),unpack(s) end local x,a,b,c,d,e,f,g,h,i=... if tonumber(a)==nil then return unpack(x),a,b,c,d,e,f,g,h,i end if tonumber(b)==nil then b=#x end return unpack(x,a,b) end until 1<2 end x=tostring(x) if tonumber(x)==nil and #x==1 then sep=x end if #arg==1 then X=0; s=... if sep==' ' then s=cut(s) end repeat X=X+1; arg[X],s=split(sep,s) until s=='' end X=0 if tonumber(arg[1])==nil then repeat X=X+1; arg[X]=tostring(arg[X]) until X>=#arg else repeat X=X+1; arg[X]=tonum(arg[X]) until X>=#arg end return unpack(arg) end --[[ function argum(K,x,y,...) if (#arg or 0)==0 then return 0 end if x<0 then x=#arg+x+1 end if y<0 then y=#arg+y+1 end if y>#arg then y=#arg end if K<0 then K=getkey(-K,...) end while x<=#arg and x<=y do if K==K then x=x end if K==24 then repeat writeln(arg[x]); x=x+1 until x>y end x=x+1 end--wh return x-1 end --]]-- function output(f,...) local X,t,str=0,2<1,stf(...) if not tonumber(f) then str=f; f=9 end while type(f)=="number" do if f<0 then newline(0,str); return writeln(str) elseif f==0 then f=mdX.."!notiX.tXt" elseif f==1 then f=mdI.."!notiX.tXt" elseif f==2 then f=Glog elseif f==3 then f=mdX.."!Environ.tXt" --elseif else print(str); f=f%10; t=1<2 if f>3 then return 0 end end--if f end--wh -- print(' -->',f,'--') local out=io.open(f,"a") or io.open(erriX,"a") if type(str)=="table" then if str[1]==nil then for ee,lin in pairs(str) do if t then print(ee,lin) end out:write(ee..(seP or " ")..tostring(lin).."\n") end else repeat X=X+1 if t then print(str[X]) end if str[X]~=nil then out:write(str[X].."\n") end until X>=#str end else X=1; out:write(str.."\n") end out:close() return X end --- :...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,.... function begin(...) local bn=BN or "fertiX" if ...~=nil then print("*<<<",...,">>>") end local K,l=0,0 basfile=log42 if U%t==0 then K=1; X=t*t; Z=X; rem="--- " else--:) for zeile in io.lines(log42) do X=X+1; l=l+#zeile; if X%100==0 then wait(0) end if zeile>"" and lstr(2,zeile)=="--" then bug=-1-bug; rem="--- " end for ee in zeile:gmatch("\34") do K=K+1 end bug=bug or K%2 if bug>0 and L>=0 then L=-L if P0 then if L==0 then L=t*t end if L>0 then L=-L end end if bug>0 then play_sound(6,"^VV^ildsch^vv^eYn?") end collectgarbage() if RW then wait(0) if eXt==".scX" then os.mkdir(lstr(-1,mdX)) end if eXt==".XxX" then bn="xyx00xyx" else if type(E)=="string" then if E:find('.')==nil then eXt=".tXt"; E=E..eXt; wa='a' end if lstr(2,E)~="A/" then E=mdX..E end basfile=E; bn=E else --if _HLP then bn=" Enter Target:" end--:) --- - if not _HLP then bn=" |\\"..bn end-- die Striche können weg, sonst getstr... bn=textbox(stf("%d rw%d %s",collectgarbage("count"),R,dd..pc..eXt) ,os.date(),bn,9) or ""; wait(0) end end if bn=="" then basfile=erriX else if tonumber(bn)~=nil then return 3 end if bn==" " then bn="!!IXIXIX" end if lstr(2,bn)~="A/" then basfile=mdX..bn..eXt end end if lstr(1,bn)==" " then ch4=string.sub(bn,2,1) basfile,K=getfile(dd) if K==3 then return 3 end end if log42==basfile then basfile=mdX.."tempX"..eXt print("*<< = >>--->"..basfile.." >") end if log42==basfile or bn=='' then RW=false end end if RW then ee="rw"; rw=1 else ee="RO"; rw=0 end if type(F)=="string" then find_str=F else if F>0 then local Fnd={"function (x,...--:)", "for =*+-,,???remd_---","while (<=~=>)","until (<=~=>)", "if (<=*+-~=>) and or then","=elseif <=~=>gosubto##", "--- 88><:",">#Fnd then F=#Fnd end find_str=textbox(basfile,pc..ee..lineal,Fnd[F],t) Fnd=nil end find_str=find_str or "><" end find_str,rep_str=split("><",find_str) collectgarbage() sec=get_tick_count() printf(rem.."<>> %d %s %d",X,basfile,-bug*t) if A>X then A=X end if P<0 then P=X+P end if P>X then P=X+1 end if Z<0 then A=X-Z; Z=X end if Z>X then Z=X end remV=rem.."<"; rC=lstr(1,rem) basline=lineal --basline=bn return 0 end function nubas(camera_name) local n=camera_name or "PC" txt=io.open(log42,'r'); Li=0 if RW and not TF then Lo=0 bas=io.open(basfile,wa) RV=P==P; writeln(rem.."< scriptiX für "..n.." >") RV=P==P; writeln(rem.."< "..log42..' -- '..os.date().." >") end end function head(...) if ...~=nil then print(...) end local bi=_HLP and "PC" or get_buildinfo() nubas(bi.platform) if RW then RV=P==P writeln(printf("%s< %d@ %s%s ß%d >",rem,U,pc,basfile,-collectgarbage("count"))) else printf("%s %s %s >",remV,ee,string.upper(bi.platform or "You")) end end function readln(...) local x=0 zeile=... if Z-C*rw>Li then if txt==nil or Li<0 then zeile=edlin(zeile or "") else if A0 then zeile=lstr(x-1,zeile) end end if cb1=="*" and not RV then zeile=ins_block(zeile) end if cb1==rC and lstr(4,zeile)==rem and #zeile>4 then zeile=rem_block(zeile) end end size_r=size_r+#zeile end return zeile end function play_string(x,...) return ... end --[[-- Ubasic spec. only local E,str=0,... lenz=string.len(...) for i=1,bug*lenz do if string.sub(...,i,i)=="\34" then E=E+1 end end while E+bug==0 do E=2 if (L>=0) and (string.find(...,"^",1,1)~=nil) then str="" for i=1,lenz do ee=string.sub(...,i,i) if ee=="^" then E=E+1; ee="\34" end str=str..ee end end end Err=E%2 for E=1,Err do Error=Error+t str=str.."\34" writeln(printf("%s %d %s %d",rem.."< "..pc,Li," EYn ^VV^ildsch^vv^eYn! >",Lo)) play_sound(2) wait_click(W*t) if RW and x~=0 then str=edlin(str) end end return str end --]]-- function newline(x,...) if not W then return print('!!! ',...) end if W<0 then return (...) end local str=... --print(Li,Lo,pc,str..";") while (R==2) and rstr(3,str)=='---' do str=lstr(-3,str)..cut(readln()) end if (bug==0) and (L>=0) and (str:find("^")~=nil) and (x120 then local s,sr=str,"" repeat s,sr,x=split(120,s) print(s); s=sr; wait(W+2) until x<1 else if TO or not Lo then print(str) elseif Li==Lo+1 or Lo<0 then printf("%d%s%s;",Li,pc,str) else printf("%d%s %d",Li,pc..str..';',Lo+1) end end ti=wait(W) if ti>t then II=II end return str end function writeln(...) local str=... if str==nil or rep_str=="^" and not str:find(find_str) or rep_str=="." then return end if (find_str=="" or str:find(find_str)~=nil) and K~=t then if find_str=="" and isfile(mdX..rep_str) then str=filter(str) else if #find_str>0 then str=fire(find_str,rep_str,...) end end end if Lo>=0 then if R~=1 and (str=="") or str==("**") then str=printf("%s%d %d",rem..":-)",Li,Lo) end if io.type(bas)~="file" then TF=P==P; play_sound(6,erriX) bas=io.open(erriX,"w"); basfile=erriX end --| --tfil=io.tmpfile() end --bas=io.open(basfile,"a") end if RV or lstr(5,str)~=remV then if repZ<0 then repZ=-repZ end for x=1,repZ do Lo=Lo+1; bas:write(str..crLf) size_w=size_w+#str end RV=1<1; repZ=1 end end end function tail(x) play_sound(1-bug,"tail") for i=1,rw do K=x or getkey(2200) if K==2 and isfile(erriX) then fcopy(24,erriX) end if K>19 then arX=newline(1,arX); writeln(rem..arX) end --[[-- if TF then bas=io.open(basfile,"a") for z in io.lines(tfil) do newline(z); writeln(z); collectgarbage() end os.remove(tfil) end ]]-- end end function done() if (Lo>=0) and (eXt==".XxX") then RW=1<1 txt:close() bas:close() os.remove(log42) os.rename(basfile,log42) basfile=log42 RR=1<1 end print(X,-Li,Lo,-size_r,size_w,-Error) print(U,basfile,"in s",sec-get_tick_count()/t) if _HLP then return end K=getkey(5005) --- - if K>20 and eXt==".Lua" then run(6,basfile) end for x=13,0,-1 do set_console_layout(0,0,x*3,x) console_redraw() sleep(88) end end --- :...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,.... function input(x,...) local str="" if type(x)=="string" then str=x else str=tostring(x) end str=textbox("Input "..str,cut(...),"",t) if _HLP then str=io.stdin:read() end wait(0) if str==nil then str=tostring(x) end if str==" " then str=... end if str=="@" then str=...; Z=0 end if str=="G" then golog(...) end if str=="P" then str=fpath(...) end if str=="F" then str,E=getfile(mdX) end if str==nil then str=tostring(x) end if str=="A" then return edlin(...) end if str=="R" then return readln(...) end if str=="T" then x=readln(...); return input(...,x) end return str,tonum(1,str) end function prompt(x,...) local str=... local z=0 if str==nil then str="" end if x<0 then x=getkey(-x,...) end while x==t do x=0; local fil,m,n=... if m==nil then fil,m=split(',',cut(fil)) end fil=fpath(fil) if m~=nil then setarg(m,n) end if str=="" or not isfile(fil) then x=1 else for str in io.lines(fil) do z=z+1 if str>"" then cb1=lstr(1,str) if cb1=="*" then str=ins_block(str) end if cb1==rC and lstr(4,str)==rem and #str>4 then str=rem_block(str) end end if rstr(5,str)~=remV then x=dostr(-z,str) end collectgarbage() end--for if x==0 then II=II else x=0; str=" " end end end --wh --- while x==42 do x=0 str=textbox(stf("%d:%s",Li,cut(basline)),cut(...),str,t) end--wh if x>0 then str=textbox(stf("%d:%s",-z,cut(basline)),cut(...), [[--- < pc="> "; acT=0; repZ=1; --=*+-\\\\""; =*+-; --]]..str,t) end if str~=nil and lstr(2,str)~=" " then dostr(-z,str) end if repZ>1 then str=basline.." " end wait(0) return str,z end function dostr(x,...) -- CAM only (wg."Environment" _G) local str=... if not tonumber(x) then str=x; x=Li or 0 end if str==nil then str=edlin(""); wait(0) end --str=textbox(log42,cut(...),...,t) or "" end local i=#str if i>2 then local as,K=0,0 -- print("--.- \%"..str) if isfile(split(' ',str)) then run(6,str) else as=assert(loadstring(str,str))() end print(str); wait_click(t,"dostr") if as~=0 then i=-i else K=getkey(5,stf("%d: %s",x,str)); ch4="E" end end return i,K end function edlin(...) if NE then return (...),tonum(1,...) end --if not ... then error(' EYn ^VV^ildsch^vv^eYn!',2) end local str=tostring(...) if _HLP and bas then bas:flush() end if #str>123 then printf("--- LINE %d TOO LONG TO EDIT (%d)",Li,#str) return ... end repeat repeat ch4="üx" repeat if str=="A" then str=... end if str==" " then str=" A S" end str=textbox(stf("%d:%s",Li,cut(basline)),cut(...),str,t) if (str or "")=="" then str="-- -.-" end until #str>2 while str:sub(1,3)==" A " do ch4=str:sub(4,4) str=str:sub(4,t) if str=="" or lstr(2,str)=="AT" then str=" " end if str~=" " and ch4~=nil then str=check(ch4,str) if not _HLP then return edlin(str) end end end wait(0) until str~=" " K=0; ce=rstr(1,str) if ce==' ' and str~=" " and if_x2 then newline(t,str); RV=P==P; writeln(str) if rstr(1,str)~=';' then str=' ' end else K=0 end end if lstr(1,str)==";" then Go=golog(str) end if ce==')' and lstr(1,str)=='(' then arX=str end until K==0 if str~=... and Li and (L==Li or L==-Li) and if_x0 then L=Li+1 end if L<0 then L=Li-1 end end return str,tonum(1,str) end function check(chr,...) local str=... ch4=chr if chr=="(" then arx=str end if string.find("/|\\_>GPRV",ch4)~=nil then str=rstr(-1,str) end ---<<~=!! if chr=="V" then remV=str end if chr==">" then find_str=str end if chr=="_" then rep_str=str end if chr=="G" then golog(str); str=rem..chr..str end if chr=="P" then prompt(1,str); str=rem..chr..str end --- - if chr=="R" then run(5,str); getkey(2,str) end if string.find("RV(",chr)~=nil then str=rem.."<"..str end while string.find("/|\\ABCDEF)HILMOSTXZ",ch4,1,1)~=nil do ch4="K" ---<<~=!! str=getstr(chr,str) end -- if ch4=="E" then str=rem.." ??? Error --- ^ "..str end if str=="" then str=rem end while ch4=="K" do K=getkey(0," "..str) if K==0 then return str end while K20 then ee=fcopy(K,str) --letzte Zeile if ee~="--" then K=getkey(0,ee); ch4="XX" end end while K==29 do run(6,str) K=getkey(0," "..str) if K==4 then str=textbox(stf("%d:%s",Li,cut(basline)),ee..lineal,str,t) K=getkey(0) end end if K==9 then basline=str; pau=t end if K==6 then return str end if K==5 then str=" A "..str end if K==4 then str=rem.."?"..str end if K==2 then Go=golog(str) end if K<22 then K=t end end end if ch4~="XX" then ch4="XX" else ch4="K" end return str end -- Wird aktiviert, wenn Scriptix mit R ---/ == >Parse sich selbst filtert. -- Dann kann man Lua-Scripte wie dieses, deren Parameterblock gegen nil abgesichert ist, -- in den Ablauf einbinden - soweit der Speicher reicht. -- Adapterzeile f. SHOOT.lua: a=a or 2 -- -- " -- f. EDI.lua: a=a or 0; b=b or 0; n=n or 0; s=s or 1; x=x or 44; y=y or 13 -- Diese können auf der CAM (wg. Environment _G) auch hiesige functions aufrufen. --- - --[ [--:) function run(K,exe,...) local ex,ret,str=0,"",... local d,e,h,tt,p,l,f,r,i,j,c,a,z,g,w,u,y,ti= D,E,H,T, P,L,F,R,I,J,C,A,Z,G,W,U,Y,0 local Rem,pC,bf,l42,li,lo,sr,sw,rW,go,tO,ii,sep,x= rem,pc,basfile,log42,Li,Lo,size_r,size_w,rw,Go,TO,II,seP,X t=1000 if not tonumber(K) then exe=K; K=5 end--:) if K==-t then K=2; ti=0 end if tostring(D)==sX then D=0 if type(E)=="string" then E=0 end end if io.type(txt)=="file" then txt:close() if (Lo or 0)>0 then bas:close() end end--RW Li,J,A,C,Z,rC,s=-t,0 --=ACZ...=nil if str~=nil then arX=... end -- if arX=="" then arX="D,E,2,9,1,-2,F,0,0,0,C,A,Z,G,22,222" end if exe:find(" ")~=nil then exe,arX=split(" ",exe) end if not isfile(exe) then exe,Li=split(" ",fpath(exe)) if Li~="" then arX=Li end end if (K==2) and arX~="()" then arX=textbox(cut(basline)..lineal,exe,arX,t); wait(0) end arX=arX or "" collectgarbage() print_screen (-44) print('--- '..os.date(),-K) if string.sub(arX,1,2)==" " then arX="" end if K==0 then K,ti=getkey(2,"-+- "..exe) end if ti>555 then exe=sX end print(rem,K,Li,Lo,exe,arX,-collectgarbage("count")) --[= =[--PC if _HLP then if K<0 then print(exe,' ',arX) repeat K=K+1 until isfile(exe) end--:) if lstr(2,exe)~="A/" then K=t os.execute('%COMSPEC%/T:4E/C'..exe..' '..arX) end end --]==]-- if K==9 then prompt(t,exe,arX) end if K<8 then local gsub,err=loadfile(exe) if not gsub then error(err,2); getkey(6,exe) end if K==7 or _HLP then seP=',' ex,ret=pcall(gsub,setarg(arX)) print('----',ex,ret) else if K<3 then ex,ret=assert(gsub)(arX) end if K==3 then ex,ret=assert(gsub)(...) end if K==4 then ex,ret=assert(gsub)(D,8,2,9,1,-2,F,0,0,0,0,0,0) end if K==5 then seP=','; ex,ret=assert(gsub)(setarg(arX)) end if K==6 then ex,ret=assert(gsub)() end end end arX=arX or ""; str=str or exe if K<=t then newline(0,"--- ? "..str.." ("..arX..")") end if K>=t then writeln("--- ? "..str.." ("..arX..")") end print(-K,os.date(),-collectgarbage("count")) getkey(1,ex,err,Li,Lo,lineal) print_screen (0) collectgarbage() pc,basfile,log42,Li,Lo,size_r,size_w,rw,Go,TO,II,seP,X,rem= pC,bf,l42,li or -2,lo,sr,sw,rW,go,tO,ii,sep,x,Rem or '--- ' D,E,H,T, P,L,F,R,I,J,C,A,Z,G,W,U,Y,t= d,e,h,tt,p,l,f,r,i,j,c,a,z,g,w,u,y,1000 RW=rw==1; pau=t remV=rem.."<"; rC=string.sub(rem,1,1) if not _HLP then for x=0,14 do set_console_layout(0,0,x*3,x) console_redraw(); sleep(77) end set_console_layout(0,0,45,14) end if Li>0 then for x=1,rw do bas=io.open(basfile,'a') end txt=io.open(log42); for x=1,Li do txt:read() if x%42==0 then collectgarbage() end end end wait(W+1) return ex,ret,err end --end ---*]] -- ...stenographische Elemente... function filter(str,fil) fil=fil or rep_str while type(fil)=="number" do if fil==0 then fil=rep_str elseif fil==1 then fil="complete.tXt" elseif fil==2 then fil="shortcut.tXt" elseif fil==6 then fil="edlin.tXt" --elseif else fil="wood.tXt" end end if not isfile(fil) then fil=mdX..fil --fil=fpath(fil) if not isfile(fil) then return str end end --[ [--:) _HLP if _HLP and not WOOD then WOOD={setarg(fil)} end if WOOD then for x=1,#WOOD do K=t; --print(collectgarbage("count")) str=fire(WOOD[x],seP,str) end; K=0 else --]]--! for wood in io.lines(fil) do K=t str=fire(wood,seP,str) end; K=0 end --;) collectgarbage() -- end --:(! return str end --- >^function fire><| function fire(find,rep,...) local K,str=K,... if not rep then return ... end -- if find=='"' then find,str=split('"',str); return split('"',str) --:( if rep=="" then K=getkey(9) if RW and (K<8) then pau=t; if K>4 or _HLP then return edlin(str) end end end if find=='"' then find,str=split('"',str,1,1) return split('"',str,1,1) end if rep==seP then find,rep=split(seP,find) if K==t and lstr(2,find)=="--" then return str end end if #rep==1 then local i=tonumber(rep) if rep=="!" then golog(str) else if i~=nil and repZ>-1 then repZ=i else if rep=="@" and repZ>-1 then find,str=split(seP,str); writeln(find) end if rep==";" then str=readln(); str,rep=split(seP,str) end if rep=="|" then bas:close(); Lo=0 end --fsplit>erroriX.tmp if rep=="?" then rep=input(find,str) end if rep=="/" then rep=fpath(find) end if rep=="=" then rep=find end if rep=="+" then rep=os.date() end if rep=="§" then rep=img_info(0,"") end if rep=="-" then return string.sub(str,6,t) end if rep==":" then return string.sub(find,1,5)..str end if rep=="~" then return string.reverse(str) end if rep==">" then return string.upper(str) end if rep=="<" then return string.lower(str) end if rep=="{" then return split(seP,str) end if rep=="}" then find,str=split(seP,str) end if rep=="[" then return split(find,str,1,1) end if rep=="]" then find,str=split(find,str) end if rep=="#" then find_str=find; rep_str="" end end end end if #rep>1 then if rep=="\59;" then rep="" end -- ;; if rep=="\45+" then rep="\42" end -- -+ * Fehlen in textbox(): *,|,\ if rep=="\45/" then rep="\\" end -- -/ \ if rep=="\64@" then rep="\13\10" end -- @@ if lstr(4,rep)==rem or rstr(1,rep)==";" then str=rep..str else if lstr(1,rep)==";" then str=str..rep else if repZ>-1 then str=string.gsub(...,find,rep) end end end end return str end function ch_block(get1,ch2,st3,...) if _HLP and string.find('%&?!;',ch2,1,1) then return zeile end -- CAM only if ...~=nil then RV=P==P; writeln(rem.."<",...,">") end local str=... if ch2=="." then ch2=lstr(1,st3); acT=tonumber(ch2) or 0 return str end if ch2=="-" then ch2=lstr(1,st3); K=tonumber(ch2) or 0 if K>0 then if acT==K then st3=rstr(-1,st3) else st3=str end end while st3=="" do Z=Z; st3=readln() st3="--- :"..st3 end return st3 end --- ---- -z=--- -z if ch2==";" then st3=fpath(st3) end if ch2==">" then find_str=st3 if st3:find("><") then find_str,st3=split("><",st3) end ch2= "_" end if ch2=="_" then WOOD=nil if st3:find("}{") then st3,ch2=split("}{",st3) end rep_str=st3 if ch2~="_" then return ch2 end end if ch2=="!" then if st3:find("=")==nil then dostr(Li,stf([=[ee=%s]=],st3)) else dostr(Li,stf("ee=[[%s]]",st3)) end dostr(-Li,ee); K=getkey(2,ee) if K==2 then ee=stf('%s',basline); writeln(ee); ee=dd end if K==4 then ee=zeile end if K==5 then prompt(42,ee) end if K==6 then ee=prompt(42,dd) end str=ee end --II=II end if ch2=="&" then dostr(Li,st3) end if ch2=="%" then dostr(Li,[[ee=string.format(]]..st3..[[)]]) str=ee end if ch2=="]" then pc=st3 end if ch2==":" then if st3=="" then st3=lineal end str=rem.."-"..rem.."-"..rem..":"..st3 end if ch2=="^" then str=edlin(zeile); wait(1) end if ch2=="+" then str=basline; repZ=tonum(st3); get1=1<1 if repZ==nil then repZ=1; writeln('--- +') return rem..os.date() end if repZ==0 then golog(str) end if repZ<0 then II=II end end if get1 then str=getstr(ch2,st3) end ---("/|\\ABCDEF)HILMOSTXZ")~=nil if str==nil then str=erriX end if ch2=="[" then A=Z-1; if str:find(".",4,1)~=nil then tpx=io.open(st3,"w") end readln(str) if tpx then txp:close(); tpx=nil; tpX=st3 end end --cut[&save] -> *]]-- if ch2=="{" then run(3,st3) end if ch2=="}" then str=prompt(t,st3) end return str end function ins_block(...) --[ [ local str=... local st3=str:sub(3,t) local get1=#str==3 ch2=string.sub(...,2,2) zeile=rem.."< --- *"..zeile.." >" for i=1,II do print(zeile) if string.find("/|\\+-_.:;^>!%&{}[]",ch2,1,1) then str=ch_block(get1,ch2,st3,...) end if ch2=="(" then arX=st3 end if ch2==">" or ch2=="_" then str=... end if ch2=="*" then writeln(rem.."*? (]wwwwww> +|-|=)?") end if ch2=="!" then K=getkey(3,str) II=II end if ch2=="?" then str=edlin(rem..str.."???:##(<=~=>)end") end if ch2=="<" then RV=P==P; if st3~=nil then remV=st3 end repeat readln(); print(zeile) until Li==Z or lstr(2,zeile)~="*<" K=getkey(2); str=zeile end ---[ [ Reserviert f. keylogiX.bas :###include *#* Blox --- (!DIY!) ]]-- if ch2=="\35" then II=II end if ch2=="=" then II=II end if ch2=="@" then II=II end end --for II if str==... then str=zeile end --]]-- return str end function rem_block(...) local str=... local st3=string.sub(str,6,t) local get1=#str==6 ch5=string.sub(str,5,5) if R==2 then --- rems auswerten? if string.find("/|\\+-_.:;^>!%&{}[]",ch5,1,1)~=nil then str=ch_block(get1,ch5,st3,...) end if ch5=="?" then str=edlin(...) end if ch5=="(" then arX=st3 end if ch5==">" or ch5=="_" then repZ=-1 if str~="" and str~=... then str=rem..ch5..str end end if ch5=="§" then klix(2,st3) end if ch5=="*" then str="\42"..st3 end if ch5=="@" then Z=0 end if ch5=="!" then K=0 --:) while K>8 do K=getkey(2,str) II=II end end while string.sub(str,4,6)==" A " do ch4="Do" str=string.sub(str,7,t) str=check(ch4,str) end end --if R==2 if R==1 then str=rem.."<>" end return str end function fcopy(K,...) local lin=... local x=0 for str in io.lines(fpath(...)) do x=x+1 if str~="" and #str>5 then lin=str if lstr(5,str)=="--- (" or lstr(5,str)==rem.."(" then lin=rstr(-5,str); arX=lin end end if K<8 then output(K,str) end if K==8 then if pc=="> " then printf("%d. %s",x,str) else print(str) end end if K==22 then golog(str) end if K==24 then str=newline(t,str); writeln(str) end collectgarbage() end -- for if K==8 then getkey(1,lin.." -- ",arX) end return lin,tonum(lin) end function isfile(f,...) if f==nil then return 2<1,"NIL" end --if type(f)=="number" then return 2<1,tostring(f) end local x,is,str="NIL",type(f)=="string" and os.stat(f) and (io.open(f)~=nil) --[[-- not _HLP local x,is,str="NIL",pcall(io.open(f)) -- nett, aber G7 & is=str:find("userdata")~=nil -- Ix900Ti gehen aus--]]-- ^^ if is then str=f; x=io.type(f) end --getkey(0,tostring(is)..str) return is,str,x end function fpath(f,...) mdX=mdX or ""; mdI=mdI or "" local dd,dir='', mdX..";SCRIPTS;LOGS;BOOKS;HELP;DATA;LOGS/logiX;;SCRIPTS/TEST;"..mdI -- while type(f)=="number" do II=II -- return end if isfile(f) then dd=f while rstr(1,dd)~="/" do dd=lstr(-1,dd) end return f,dd end if lstr(2,f)=="A/" then return f,"--- ^nofile:"..f end if path~=nil then dir=path..';'..dir end repeat dd,dir=split(';',dir) if lstr(2,dd)~="A/" then dd="A/CHDK/"..dd end if rstr(1,dd)~="/" then dd=dd.."/" end if isfile(dd..f) then return dd..f,dd end until #dir==0 return getfile(dd,...) end function getfile(dd,...) local E,ee=-1,dd if ...~=nil then print(...); sleep(t) end if isfile(dd) then return fpath(dd,...) end ee=ee or 'ä' if lstr(2,ee)~="A/" then dd="A/CHDK/" end if rstr(1,ee)~="/" then ee="SCRIPTS/" end if dd~=ee then dd=dd..ee end repeat E=-1 repeat ee=file_browser(dd) or ""; wait(1) E=E+1 until ee~="" or E==3 if _HLP and not isfile(ee) then ee=dd..ee end if E==1 then if string.upper(rstr(3,ee))=="LUA" then run(-t,ee,...) else prompt(t,ee) end II=II end if E==2 then prompt(42,stf([[L=%2d; F=%d; R=%d; T=%d; G=%d; acT=%d; ee=%s]],L,F,R,T,G,acT,[['="\\";=*;=']])) if T==1 then II=II end end until E==0 or E==3 return ee,E end function getstr(chr,...) local K=1 local str=... --if not str then return "" end if str=="" then str="S" end if str=="(" then str=rem..os.date() end if str=="C" then str="A/CHDK/" end if str=="A" then str,K=getfile(); if str==nil then str="E" end end if str=="E" then str=rem.."< ??? Error --- ^ >"..basline; ch4="er" end -- if str=="F" then str='--- ? function xyz(x,y,z,...)\\n-- -- /S\\nend\\n--- ? for u=1,11 do xyz(u,x,-z*(y+x),...) end; return yx end' end if str=="I" then str=tpX or "X" end if str=="X" then str=mdX end if str==")" then str=arX end if str=="O" then str=erriX end if str=="B" then str="A/CHDK/BOOKS/" end if str=="H" then str="A/CHDK/HELP/" end if str=="L" then str="A/CHDK/LOGS/" end if str=="S" then str="A/CHDK/SCRIPTS/" end if str=="T" then str="A/CHDK/SCRIPTS/TEST/" end if str=="Z" then str=sX end if str=="M" then str="M=md_detect_motion(a,b,1,d,e,f,g,h, i,j,k,l,m, n,o,p)" end if rstr(1,str)=="\13" then str=lstr(-1,str) end if lstr(2,str)=="A/" then while str:find(".",3,1)==nil do str=getfile(str) if _HLP then break end end K=string.find("/|\\",chr,1,1) or 0 if K>0 then writeln(rem..str) if K==1 then fcopy(24,str) end if K==2 then prompt(t,str) end if K==3 then run(2,str) end str=rem..str.." -- end "..ch4 end end if str and K*#str>1 then str=textbox(cut(basline),cut(zeile),str,t) end wait(1) if str and #str==1 then ch4="E" end --getkey(5,chr..ch4) return str end function getkey(x,...) local K,ti,t=0,0,1000 --print('--',...) --if ...~=nil then print(stf('*<%s>',...)) end if ...~=nil then print(setarg("*<",...,">")) end if x") end collectgarbage() --[==[--:) if _HLP then io.stdout:flush() K=tonum(io.stdin:read(2)) -- or 0 -- print(remV,K) -- zB auch 02040042 --if K==42 then II=II end etc.. _HLP end --]==]-- if _HLP then return K,0 end x=x or 42 if x<10 then sleep(33) console_redraw() repeat wait_click(9) until is_key "no_key" if x<8 then play_sound(x) end wait_click(t*t,"getkey") if x~=8 then sleep(123) end end if x>t then wait_click(x); K=x%100 end ti=get_tick_count() while is_pressed "face" do K=1 end while is_pressed "up" do K=2 end -- while is_pressed "video" do K=3 end while is_pressed "left" do K=4 end while is_pressed "set" do K=5 end while is_pressed "right" do K=6 end -- while is_pressed "display" do K=7 end while is_pressed "down" do K=8 end while is_pressed "menu" do K=9 end -- while is_pressed "help" do K=11 end while is_pressed "playback" do K=13 end -- while is_pressed "print" do K=16 end while is_pressed "zoom_in" do K=22 end while is_pressed "zoom_out" do K=24 end while is_pressed "shoot_half" do K=29 end ti=get_tick_count()-ti while x==t do x=0 K=get_orientation_sensor() if Go==nil then Go=K/90+99 end if K==0 then G=Go else play_sound(1+K/90) end if K==90 then G=G-1 end if K==270 then G=G+1 end end return K,ti end function menux(...) local K,ti=getkey(2) -- if ti>t*t then II=II end if ti>t then ti=pcall(prompt,42,basline) and 0 or t end --- - if K==24 then run(6,sX) end --("D,8,2,9,1,-2,F,0,0,0,C,A,Z,G,11,111") end --- - if K==22 then run(2,sX) end repeat if K==29 then klix(1,...); K=9 end if K==13 then press "playback"; wait(5); release "playback"; K=9 end if K==2 and ti>333 then help(""); K=9 end if K==4 then if ti>333 then basline=rem..":-) ".. basline end ti=t end if K==5 and ti>333 then exitalt(5,"*"); K=9 end if K==6 then basline=edlin(" A AT"..basline); ti=t end if K==8 and ti>333 then W=0; WP=1<1 if ti>t then find_str="" end end if K==9 then K,ti=getkey(t+9) if ti>333 then K=submenu(K); ti=t end end -- if not _HLP then console_redraw() end wait(9) until K~=9 and _HLP or get_alt_mode() return K,ti end function submenu(K) II=II --opt. Touchscreen? return K end --- :...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,.... function scriptix(...) --(D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y) -- Zum Experimentieren: print(D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y); --error('##',2) --print('--- <',collectgarbage("count"),'>',type(...),setarg(...)) --G=7; print('--- <',collectgarbage("count"),'>',setarg(_G," ")) if arg then print('--- <',collectgarbage("count"),'>',#arg,...) end local function restore(...) D,E,ee=0,0,... or os.date if not _HLP then set_aelock(0); set_aflock(0) set_console_layout(0,0,25,5) set_console_autoredraw(1) end if Li>=0 then if RR then txt:close() if RW then bas:close() end end end print(U,"scriptiX:",Li,Lo,-Error) K=getkey(2004,collectgarbage("count"),...) collectgarbage() return ee end t=1000 arX=(...) mdI="" mdX="A/CHDK/SCRIPTS/" sX=mdX.."scryptiX.Lua" if compat or not isfile(sX) then sX=mdX.."ScriptiX.Lua" end if H>=0 then ee,mdI=img_info(t,arX) Hf={"---","H","L","S","B","german.HLP"} hfil=Hf[H+1]; Hf=nil end if isfile(D) then log42=D else log42="" dir={"SCRIPTS/","LOGS/","BOOKS/","HELP/","LOGS/logiX/"} --if type(D)~="number" then error([[ EYn ^VV^ildsch^vv^eYn! ]]..tostring(D),2) end --(~~[[File not found:]] dd=dir[D+1]; dir=nil end --- ".XxX" gewählte Zeilen editieren; Datei direkt modifizieren. if type(E)=="number" then ext={".Lua",".bAs",".tXt",".baK",".Tmp",".lOg",".scX",".XxX",".xXx"} eXt=ext[E+1]; ext=nil else eXt="" end eXt=eXt or ".eXt" if eXt==".lOg" then mdX="A/CHDK/LOGS/" end if eXt==".scX" then mdX="A/CHDK/LOGS/logiX/" end dd=dd or "SCRIPTS/" wa="w"; if eXt==".tXt" then wa="a" end ch4="ö" ee="" basfile="" Glog="A/CHDK/LOGS/!Glog.tXt" seP=" " crLf="\n" rem="rem "; remV="rem <" acT=U/t--:) bug=0 Err=0 Error=0 II=0 if_x=t*t Go=0 K=0 Li=-1 Lo=-1 rw=1 repZ=1 size_r=0 size_w=0 sec=0 X=0 RR=1<2 RW=((type(E)=="string") or (E>=0)) and (C>=0) TF=2<1 TO=A==0 NE=A<0 WP=W<-1 if WP then W=-W end if I>0 then II=1 end if J==0 then A=1; C=0; Z=t*t end if P==0 then P=t*t end if A==0 then A=1 end if A<0 then A=-A end if Z==0 then Z=t*t; crLf="\13\n" end if eXt==".XxX" and L>0 then L=-L end if hfil==nil and H>0 then H=-H end if find_str==nil then find_str="@title><" end rep_str="" erriX=erriX or mdX.."erroriX.tmp" arX=arX or "(...)" pc=pc or "> " pau=pau or 0 lineal=lineal or ":...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,...." basline=lineal zeile=lineal if type(Y)=="number" then Y=Y+1 end if type(Y)=="string" then getkey(6,pc..Y) end if Y~=nil then II=II end --[ [ if H>=0 then for x=0,14 do set_console_layout(0,0,x*3,x) print(lineal) console_redraw(); sleep(88) end end--]]-- if not _HLP then set_console_layout(0,0,45,14) end if H>0 then help(hfil) end collectgarbage() --:...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,....--begin txt2bas -- --isfile(fpath("scriptix.lua")) --isfile(fpath("log_0123.txt")) if not isfile(D) then log42,K=getfile(dd,...) if K==3 then restore() end wait(1) end K=begin(...) if K==3 then restore() end wait(1); play_sound(rw) head() if string.find("/|\\",ch4,1,1)~=nil then getstr(ch4,log42) end --if ch4=="/" then P=0; Z=-t end if_x=t; wait(1) for x=A,P-1 do readln(); writeln(zeile) end--CGA unnötig?! -- print(-P,CGC) if Li>X then Z=0 end if_x=1; wait(1) while Li=Z if RW and (L==Li or L==-Li) then zeile=edlin(zeile); pau=t end basline=newline(1,zeile) if (WP and (Li%10==0)) or (is_pressed "menu") or (pau>333) then K,pau=menux(basline) end -- if _HLP then basline=string.reverse(basline) end--:) --if basline:find(':\\',2,1) then basline=rstr(-3,basline:gsub("\\","/")) end -- -19--:) -- while basline:find(" ") do basline=basline:gsub(" ","\t") end --while basline:find("\t") do basline=basline:gsub("\t"," ") end writeln(basline) if W>0 then collectgarbage() end--!! --- - if pau>t then run(6,sX," D,4,8,9,1,-2,F,2,1,0,0,0,0,G,1,333")--:)DIY) --- - K=getkey(2222,not IX,Lo,err) end end --wh tail() done() ee=collectgarbage restore(ee) return xpcall(ee,ee) end--txt2bas -- end --scriptix(...) _HLP=tostring(tostring):find(" 00")~=nil --[ [--:) hostluaPortable _HLP :...;....1....;....2....;....3....;....4....;....5....;....6....;....7....;.... --if _HLP and (is_key "up" or 1) then _HLPK=1<2 end --find_str='function' -- if _HLP then find_str='_HLP' end-- "space"? -->> -- find_str='textbox' -- --G=7; help() --run(6,"A\\CHDK\\SCRIPTS\\envirix.lua") --NOGO --run(7,"A/CHDK/SCRIPTS/envirix.lua") --NOGO --LUA_INIT='A/CHDK/SCRIPTS/luaInit.lua' --LUA_INIT='A/CHDK/SCRIPTS/luaInit.lua' --LUA_INIT=printf('%s',textbox('LUA_INIT',tostring(tostring),LUA_INIT,99)) --if _HLP then ?Voodoo? end --:) Using CHDKhostlua-npp+++ in 30 lives todorial. -- Enter next level! -- get_shooting() or not get_shooting()? Caefix 22.03.19 if LUA_INIT then --t=1000 print(LUA_INIT) if isfile(LUA_INIT) then print(run(5,LUA_INIT)) else dostr(-1,LUA_INIT) OOO=U end end --[=[--:) function testprog(...) print('--- <- BEGIN testprog',...) --) --G=7; help() print('Mem=',collectgarbage("count"),...) collectgarbage() dostr(99,'T=99; print("T=",T)') print(" Hier könnten Deine Zeilen sein...") local x,y,z=run(5,"A/CHDK/SCRIPTS/luaInit.lua abc,_HLP,...") --local x,y,z=run(6,file_browser('A/CHDK/SCRIPTS')) print() print('>> Mem=',collectgarbage("count")) return print(x,'--- <- ENDE testprog:',setarg(y),z) --) end print(testprog(setarg(...),_HLP)) --]=]-- --[==[--:) if _HLP then function errorism(...) if lstr(2,find=="--") then return ... end end errorism() end --]==]-- --]]-- hostluaPortable :...,....1....,....2....,....3....,....4....,....5....,....6....,....7....,.... if not _HLP and Z and U then repeat IX,K=pcall(scriptix() or ":)") K=getkey(2002,IX or K); P=1 until K<21 else --OOO=U--:) test _HLP @default if OOO==nil then D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y=... end UUU=U t=1000 mdX,mdI="","" if pc==nil then pc="| " else pc="0"..pc end print("D=",D," type:",type(D),pc,XXX) print("E=",E,"H",H,"Mem:",collectgarbage("count"),_HLP) print("T",T,"P",P,"L",L,"F",F,"R",R,"I",I) print("J",J,"C",C,"A",A,"Z",Z,"G",G,"W",W,"U",U); --getkey(1,D) lineal=":...;....1....;....2....;....3....;....4....:....5....;....6....;....7....;...." if type(D)=="string" and D:find(")",1,1)==nil and isfile(fpath(D)) then D,mdX=fpath(D); rC="-"; rem="--- "; print(lineal) if D:upper()~="A/CHDK/SCRIPTS/SCRIPTIX.LUA" and ((H or 0)>=0) then if E==nil then prompt(t,D) else run(2,D,...); XXX=1 end K=getkey(1,D); if K<20 then XXX=t end end end --- : --[= ===[ Makro--:) []CONSOLE[PC] HostLuaPortable _HLP --Text v.Console heraufziehen O.K, nach hinab (zu StdIn) >>Bearbeiten Rückgängig! --if compat then P=0 end if _HLP and not compat then --[= =[-- local mdC="%WINDIR%\\system32\\" os.execute('set PATH=%cd%\\;%PATH%;C:\\WINDOWS\\system32\\&&echo --%PATH%')--NOGO os.execute('echo %PATH% &&cd&& dir/b') -- os.execute('echo %COMSPEC% /T:1F/K type %0 %*>%cd%\\ListiX.Cmd') os.execute('echo.if %~x1?==? (cmd /T:4E/Kdir/b/ad/s/on %1) else (cmd /T:1F/Ktype %0 %*)>%cd%\\ListiX.Bat') os.execute('dir /b/s *.Lua>LuaDiriX.tXt') os.execute('dir /b/ad/s/o/n|'..mdC..'find.exe /I "X"') os.execute('%COMSPEC% /Z/?') os.execute('for %a in (%COMSPEC% assoc ftype call) do %a/?') --:) os.execute('echo.for %%a in (start assoc ftype call goto exit copy del dir if for in do md rd path cd pushd popd ren set setlocal endlocal shift echo color type rem verify) do @%%a/? %~1%cd%\\cmdHLP.Cmd>%cd%\\cmdHelp.Cmd') os.execute('echo cmd /T:0E/K type %0>%cd%\\cmdHLP.Cmd') os.execute('%COMSPEC% /?>>%cd%\\cmdHLP.Cmd') os.execute('%COMSPEC% /C%cd%\\cmdHelp.Cmd ">>"') os.execute('echo %date% : %time%>>%cd%\\cmdHLP.Cmd ">>"') os.execute('assoc && set') os.execute('@echo --%CMDCMDLINE% [%CMDEXTVERSION%] %CD% (%ERRORLEVEL%)') --]==]-- BN="fertIX"; P=0 -- 01 oder .. E=0; H=-1; F=0; A=1; W=0; --U=42--:) MemWatch D="A/CHDK/SCRIPTS/SCRIPTiX.LUA" -- D="A/CHDK/SCRIPTS/fertiX.LUA"; P=1 -- D="A/CHDK/SCRIPTS/tempX.LUA" -- D="A/CHDK/SCRIPTS/YourProg.LUA" -- D="A/CHDK/BOOKS/LuaDokde.tXt"; P=1 -- D="A/CHDK/BOOKS/LuaDiriX.tXt"; P=1 -- D="A/CHDK/SCRIPTS/MyDir.tXt"; P=1 -- D="npp\\plugins\\APIs\\lua.xml"; P=1; find_str='"><"' -- D="A/CHDK/BOOKS/KeyWords.Lua"; P=1; E=-1; A=0; find_str='"><^' -- D="A/CHDK/SCRIPTS/SCRiPTiX.LUA"; P=01; find_str='>>.tXt; =anhängen H=H or 0 --- Helfix T=T or 0 --- Testschalter P=P or 1 --- 0=>t*t; nur Suche&edit L=L or 0 --- edit in_Zeile Nr. F=F or 1 --- edit out_Textsuche R=R or 2 --- 2=rems auswerten I=I or 1 --- *? Zeilen -"- J=J or 0 --- Vorsicht! C=C or 0 --- -= ReadOnly A=A or 0 --- 0=Ohne Zeilenummern Z=Z or t*t --- =|0=crLf|-letzte G=G or 0 --- 0=LOG_get_exp_count().TXT W=W or 4 --- wait U=U or get_exp_count() if not XXX then if not UUU then print("D",D,"E",E,"H",H,"T",T,"P",P,"L",L,"F",F,"R",R,"I",I," ß",collectgarbage("count")) print("J",J,"C",C,"A",A,"Z",Z,"G",G,"W",W,"U",U,"Y",Y,":",type(Y)) end if H<0 then Y=Y or 0 IX,K=scriptix(D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y) else wait_click(W*t,lineal) repeat IX,K=xpcall(scriptix(),scriptix()) -- wOw? *< error in error handling > [?That´s ttoo human!]-- K=getkey(4002,IX or K); P=1 until K<21 end end --print(D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y) return IX,K end --- @--:) --[[ --- >blah --- blahbla blah --- 88 --- + --- _sleep(t) ; --- blahbla blah --- 88 --- +3 --- ---- ---- - --- ---- _; --false --- blahbla blah ---88 --- _fasel --- blahbla blah ---88 --,D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U,Y --- % "---D%s,E%s,H%s,T%s,P%s,L%s,F%s,R%s,I%s,J%s,C%s,A%s,Z%s,G%s,W%s,U%s",D,E,H,T,P,L,F,R,I,J,C,A,Z,G,W,U --- % "---Li%s, Lo%s, Mem%s, geC%4d %s",Li,Lo,collectgarbage("count"),get_exp_count(),lineal --- ---- &R=0; --:) --- % "acT=%d; d=%3d; e=%d; f=%d; p=%d; --=",acT or 0,d or 0,e or 0,f or 0,p or 0 --- &dd=stf('%s',basline) --- !dd=textbox('blah',dd,dd,t) --- ---- ---- &dd=stf('%s',basline) --- !dd --- % "acT=%d;d=%d;e=%d;f=%d;p=%d; ---=*",acT or 0,d or 0,e or 0,f or 0,p or 0 --]]-- --- (D,E,2,9,1,-2,F,0,0,0,C,A,Z,G,1,111,Y --- :--------------------------------------- --- @ --[=[ print('--- << BEGIN A/CHDK/SCRIPTS/luaInit.lua (',...,')') print('_HLP=',_HLP,' Mem=',collectgarbage("count")) _HLP=tostring(tostring):find(" 00")~=nil T=123; print('_HLP,T=',T) if not _HLP then -- dostr(99,'T=99; print("T=",T)') end print('--- < END luainit.lua',...) return T,_HLP --]=]-- --[[--A/CHDK/SCRIPTS/wood.tXt starten mit Suche "--- >>blah[>startup dir:<", s,...); io.stdout:flush() return io.stdin:read() or "" end function camera_funcs.textbox( t, m, d, l) --line 825 print(">title:<", t) if t and m and not t:find(m,1,1) then print (">Message:<", m) end if d and m and (d~=m) then print(">default string<", d) end if l and (l<999) then print(">max len:<", l) end local res = d; io.stdout:flush() if d==nil then res=io.stdin:read() end return res or "" end -- echo ... good for tracing, not disturbing Camscreen -- function camera_funcs.play_sound(n,...) --481 print(">beep<", n, ...) end function camera_funcs.wait_click(n,...) --577 print(">wait click<", n, ...) return n end function camera_funcs.sleep(n) --686 camera_state.tick_count=camera_state.tick_count+n return n end -- etwa: if sleep(1) then return n end -->2 x OO@@@@ function camera_funcs.print_screen(n,...) --764 local _n = on_off_value(n) if _n == 0 then print(">write log file off<",...) elseif _n < 0 then print(">write log file append<",n,...) else print(">write log file on: <",n,...) end end Patch for hostluaPortable/bin/emu.lua (Ende:) if not status then io.stdout:flush() --]=]--