Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Load:if (this.listBox1.SelectedIndex != -1)
- {
- this.webBrowser1.Document.InvokeScript("SetText", new object[1]
- {
- (object) System.IO.File.ReadAllText("scripts\\" + this.listBox1.SelectedItem.ToString())
- });
- }
- else
- {
- int num = (int)MessageBox.Show("Please select a script from the list before trying to loading it in tab.", "Name");
- }
- Execute:if(this.listBox1.SelectedIndex != -1)
- {
- api.SendLimitedLuaScript(System.IO.File.ReadAllText("scripts\\" + this.listBox1.SelectedItem.ToString()));
- }
- Refresh:listBox1.Items.Clear();//Clear Items in the LuaScriptList
- Functions.PopulateListBox(listBox1, "./Scripts", "*.txt");
- Functions.PopulateListBox(listBox1, "./Scripts", "*.lua");
- Functions:public static void PopulateListBox(ListBox lsb, string Folder, string FileType)
- {
- DirectoryInfo dinfo = new DirectoryInfo(Folder);
- FileInfo[] Files = dinfo.GetFiles(FileType);
- foreach (FileInfo file in Files)
- {
- lsb.Items.Add(file.Name);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement