Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Hackmore;
  7. using Hacknet;
  8.  
  9. namespace MoreWamMod
  10. {
  11.     public class Class1 : HackmoreMod
  12.     {
  13.         public override bool onInitialize()
  14.         {
  15.             return true;
  16.         }
  17.  
  18.         public override string getModName()
  19.         {
  20.             return "DownlodadMoreWamMod";
  21.         }
  22.  
  23.         public override bool onLoadContent()
  24.         {
  25.             ModManager.addCommand("downloadMoreWam", downloadMoreWam);
  26.             ModManager.addCommand("dMW", downloadMoreWam);
  27.             return true;
  28.         }
  29.  
  30.         public override bool onLoadOS(OS osLoaded)
  31.         {
  32.             return true;
  33.         }
  34.  
  35.         public static bool downloadMoreWam(OS os, string[] args)
  36.         {
  37.             if(args.Length < 3)
  38.             {
  39.                 os.write("Usage : downloadMoreWam [get/remove] [quantity]");
  40.                 return false;
  41.             }
  42.             switch (args[1])
  43.             {
  44.                 case "get":
  45.                     os.totalRam += Int32.Parse(args[2]);
  46.                     os.write("Downloaded " + args[2] + "mb of wam");
  47.                     break;
  48.                 case "remove":
  49.                     os.totalRam -= Int32.Parse(args[2]);
  50.                     os.write("Retrieved " + args[2] + "mb of wam");
  51.                     break;
  52.             }
  53.             return true;
  54.         }
  55.     }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement