⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 script.lua

📁 很好的LUA编辑器~使用方便~但不过是英文界面的。希望大家喜欢
💻 LUA
📖 第 1 页 / 共 2 页
字号:
   _curseur.y= _curseur.y+1   _decal.x= 0   _curseur.x= 0   _Verifier_Y_ (false)endfunction _Deplacer_Curseur_ (tempo)   local compteur= 0   if tempo then      compteur= _repetition   end   if Keys.held.Left then     while Keys.held.Left do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      _curseur.x= _curseur.x-1     _Verifier_X_ (true)      _Verifier_Y_ (false)   end   if Keys.held.Right then     while Keys.held.Right do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      _curseur.x= _curseur.x+1     _Verifier_X_ (true)      _Verifier_Y_ (false)   end   if Keys.held.Up then     while Keys.held.Up do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      _curseur.y= _curseur.y-1      _Verifier_Y_ (true)     _Verifier_X_ (false)   end   if Keys.held.Down then     while Keys.held.Down do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      _curseur.y= _curseur.y+1      _Verifier_Y_ (true)     _Verifier_X_ (false)   end   if compteur>_repetition then      return true   else      return false   endendfunction _Verifier_X_ (mouvement)   if _curseur.x<0 then      if _decal.x>0 then        _decal.x= _decal.x-1       _curseur.x= 0     else        if _curseur.y+_decal.y>1 then           _curseur.y= _curseur.y-1          _Verifier_Y_ (false)          _curseur.x= string.len (_texte[_curseur.y+_decal.y])         _decal.x= 0       else          _curseur.x= 0         _decal.x= 0       end     end   end   if _curseur.x+_decal.x>string.len (_texte[_curseur.y+_decal.y]) then      if _curseur.y+_decal.y<table.getn (_texte) and mouvement then        _curseur.x= 0       _decal.x= 0       _curseur.y= _curseur.y+1       _Verifier_Y_ (false)      else        _curseur.x= string.len (_texte[_curseur.y+_decal.y])       _decal.x= 0     end   end   if _curseur.x>42 then      _decal.x= _decal.x+_curseur.x-42      _curseur.x= 42   endendfunction _Verifier_Y_ (mouvement)   if _curseur.y<0 then      if _decal.y>1 then        _decal.y= _decal.y-1       _curseur.y= 0       _Verifier_X_ (false)     else        _curseur.y= 0       _curseur.x= 0       _decal.x= 0       _curseur.x= 0     end   end   if _curseur.y+_decal.y>table.getn (_texte) then      _curseur.y= 18     _decal.y= table.getn (_texte)-18     if _decal.y<1 then        _decal.y= 1       _curseur.y= table.getn (_texte)-1     end     _curseur.x = string.len (_texte[_curseur.y+_decal.y])     _Verifier_X_ (false)   end   if _curseur.y>18 then      if _curseur.y+_decal.y<=table.getn (_texte) then       _decal.y= _decal.y+_curseur.y-18        _curseur.y= 18     else        _curseur.y= 18       _curseur.x= string.len (_texte[_curseur.y+_decal.y])       _Verifier_X_ (false)     end   endendfunction _Deplacer_Selectionneur_ (tempo, sel, decalage, lim)   local compteur= 0   if tempo then      compteur= _repetition   end   if Keys.held.Left then     while Keys.held.Left do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      sel= sel-17   end   if Keys.held.Right then     while Keys.held.Right do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      sel= sel+17   end   if Keys.held.Up then     while Keys.held.Up do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      sel= sel-1   end   if Keys.held.Down then     while Keys.held.Down do        compteur= compteur+1        Controls.read ()       if compteur>_repetition then          break       end     end      sel= sel+1   end   if sel>18 then      decalage= decalage+sel-18     sel= 18   end   if decalage+sel>lim then      decalage= lim-18     sel= 18   end   if decalage<0 then      decalage= 0     sel= lim   end   if sel<1 then      decalage= decalage+(sel-1)     sel= 1   end   if decalage+sel<1 then      decalage= 0     sel= 1   end   if compteur>_repetition then      return true, sel, decalage   else      return false, sel, decalage   endendfunction _Charger_Fichier_ (fichier)   local file= io.open (fichier, "r")   if io.type (file)~="file" then      return false   end   _nom= fichier   _texte= {}   screen.print (SCREEN_DOWN, 32, 90, "Ouverture en cours...")   screen.stopDrawing ()   for line in file:lines () do      line= string.gsub (line, "\r", "")      _texte[table.getn (_texte)+1]= string.gsub (line, "\t", "   ")   end   _curseur.x, _curseur.y= 0, 0   _decal.x, _decal.y= 0, 1   return trueendfunction _Sauvegarder_Fichier_ (fichier)   local x, tempo, a= string.len (fichier), 0   _statut= "save"   screen.stopDrawing ()   while true do      Controls.read ()     a= _Stylet_ (a)     if a~=nil then        fichier= string.sub (fichier, 1, x)..a..string.sub (fichier, x+1)       x= x+1     elseif _statut=="effacer" then        _statut= "save"       fichier= string.sub (fichier, 1, x-1)..string.sub (fichier, x+1)       if x>0 then          x= x-1       end     end      screen.startDrawing ()     screen.print (SCREEN_UP, 3, 0, fichier)     screen.print (SCREEN_UP, x*6, 0, "|", Color.new (31, 0, 0))     screen.print (SCREEN_UP, 0, 50, "Pour sauvegarder: [Start]", Color.new (31, 0, 0))     screen.print (SCREEN_UP, 0, 60, "Pour annuler: [X]", Color.new (31, 0, 0))     screen.blit (SCREEN_DOWN, 0, 0, _image[_clavier])     screen.stopDrawing ()     if Keys.held.Left then        while Keys.held.Left do          Controls.read ()         tempo= tempo+1         if tempo>_repetition then            tempo= _repetition-25            break         end       end       if x>0 then          x= x-1       end     end     if Keys.held.Right then        while Keys.held.Right do          Controls.read ()         tempo= tempo+1         if tempo>_repetition then            tempo= _repetition-25            break         end       end       if x<string.len (fichier) then          x= x+1       end     end     if Keys.held.X then        while Keys.held.X do          Controls.read ()       end       _statut= "rien"       return false     end     if Keys.held.Start then        while Keys.held.Start do          Controls.read ()       end       break     end     while not Stylus.released do       tempo= tempo+1       Controls.read ()       if tempo>_repetition then         tempo= _repetition-25         break       end     end     if tempo<_repetition-25 then        tempo= 0     end   end   _statut= "rien"   x= io.open (fichier, "w")   if io.type (x)~="file" then      screen.startDrawing ()     screen.print (SCREEN_UP, 0, 0, "L'enregistrement de \""..fichier.."\" a 閏hou

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -