From 5be773d4f027ac0f00392be80d8cc5dfb67669be Mon Sep 17 00:00:00 2001 From: MichaelTheShifter Date: Sat, 2 Jul 2016 11:35:27 -0400 Subject: [PATCH] More hacking fixes, httpget() lua function. Implements aren-cllc's httpget() lua method. Works perfectly. --- source/WindowsFormsApplication1/Engine/Lua_Interp.cs | 7 +++++++ source/WindowsFormsApplication1/Gameplay/HackUI.cs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/WindowsFormsApplication1/Engine/Lua_Interp.cs b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs index c4a9162..ed9c31f 100644 --- a/source/WindowsFormsApplication1/Engine/Lua_Interp.cs +++ b/source/WindowsFormsApplication1/Engine/Lua_Interp.cs @@ -111,6 +111,13 @@ public LuaInterpreter() /// public void RegisterCore() { + mod.httpget = new Func((url) => + { + WebRequest request = WebRequest.Create(url); + Stream requestStream = request.GetResponse().GetResponseStream(); + StreamReader requestRead = new StreamReader(requestStream); + return requestRead.ReadToEnd(); + }); //Shifter Extension API mod.shifter_add_category = new Action((name) => { diff --git a/source/WindowsFormsApplication1/Gameplay/HackUI.cs b/source/WindowsFormsApplication1/Gameplay/HackUI.cs index efafb25..a1c1555 100644 --- a/source/WindowsFormsApplication1/Gameplay/HackUI.cs +++ b/source/WindowsFormsApplication1/Gameplay/HackUI.cs @@ -1168,7 +1168,7 @@ private void HackUI_Load(object sender, EventArgs e) tmrvisualizer.Start(); } - #region ENEMY + #region ENEMY private EnemyHacker ThisEnemyHacker { get; set; } public List AllEnemyComputers = null; public Computer ThisEnemyPC { get; set; }