Advertisement
PareX

Monaco Script List

May 29th, 2019
6,716
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. Load:if (this.listBox1.SelectedIndex != -1)
  2.             {
  3.                 this.webBrowser1.Document.InvokeScript("SetText", new object[1]
  4.                 {
  5.           (object) System.IO.File.ReadAllText("scripts\\" + this.listBox1.SelectedItem.ToString())
  6.                 });
  7.             }
  8.             else
  9.             {
  10.                 int num = (int)MessageBox.Show("Please select a script from the list before trying to loading it in tab.", "Name");
  11.             }
  12. Execute:if(this.listBox1.SelectedIndex != -1)
  13.             {
  14.                 api.SendLimitedLuaScript(System.IO.File.ReadAllText("scripts\\" + this.listBox1.SelectedItem.ToString()));
  15.             }
  16. Refresh:listBox1.Items.Clear();//Clear Items in the LuaScriptList
  17.             Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
  18.             Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
  19. Functions:public static void PopulateListBox(ListBox lsb, string Folder, string FileType)
  20.         {
  21.             DirectoryInfo dinfo = new DirectoryInfo(Folder);
  22.             FileInfo[] Files = dinfo.GetFiles(FileType);
  23.             foreach (FileInfo file in Files)
  24.             {
  25.                 lsb.Items.Add(file.Name);
  26.             }
  27.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement