Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function get_bookmarks()
- local tab = {}
- local posi = 0
- local posf =0
- local pos2i = 0
- local pos2f =0
- local url = ""
- local name = ""
- local i =0
- if files.exists("ms0:/PSP/SYSTEM/BROWSER/bookmarks.html") then
- for linea in io.lines("ms0:/PSP/SYSTEM/BROWSER/bookmarks.html") do
- i = i+1
- a,b = string.find(linea,'HREF="')
- if a and b then
- posi=b+1
- c,d = string.find(linea,'"',posi+1)
- if c and d then
- posf =d-1
- url = string.sub(linea,posi,posf)
- e,f = string.find(linea,'>',posf+1)
- if e and f then
- pos2i = f+1
- g,h = string.find(linea,'</A>',pos2i)
- if g and h then
- pos2f = g-1
- name = string.sub(linea,pos2i,pos2f)
- end
- end
- table.insert(tab,{url=url,name=name})
- end
- end
- end
- return tab
- end
- return false
- end
- function edit_autorun()
- os.message("Escribe el label")
- --Leemos el inf, si existe devuelve al label, si no devuelve ""
- local label = ini.read("ms0:/autorun.inf","autorun","label","")
- --Escribimos un nuevo label
- label = os.osk("Escribe el label:",label,20,10,10)
- --Escribimos el label al inf
- ini.write("ms0:/autorun.inf","autorun","label",label )
- os.message("Elige una imagen")
- --Copiamos la imagen a la raiz con el nombre de icon.png
- files.copy("","ms0:/icon.png")
- --Escribimos que el icon es el icon.png
- ini.write("ms0:/autorun.inf","autorun","icon","icon.png")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement