/// <summary> /// Open the address book /// </summary> /// <returns>True on success, false otherwise</returns> public bool open() { InterfaceResponse iresp = (InterfaceResponse)com.sendCall(FunctionCallFactory.CALLS.GETPEOPLEANDPLACES, Response.RESPONSES.INTERFACERESPONSE); if (iresp == null) { Console.WriteLine("addressbook is null"); return(false); } m.move(new Point(ran.Next(iresp.X + 10, iresp.X + iresp.Width - 10), ran.Next(iresp.Y + 4, iresp.Y + iresp.Height - 4))); Thread.Sleep(ran.Next(200, 300)); m.click(true); pm.synchronize(m); return(true); }
/// <summary> /// Scroll down the userlist /// </summary> /// <returns>True on success, false on failure</returns> public override bool userlistScrollDown() { InterfaceResponse iresp = (InterfaceResponse)com.sendCall(FunctionCallFactory.CALLS.GETLOCALCHATSCROLLBAR, Response.RESPONSES.INTERFACERESPONSE); if (iresp == null) { return(false); } m.move(new Point(ran.Next(iresp.X + 3, iresp.X + iresp.Width - 3), ran.Next(iresp.Y + 3, iresp.Y + iresp.Height - 3))); Thread.Sleep(300); m.drag(new Point(iresp.X, iresp.Y + iresp.Height)); pm.synchronize(m); return(true); }
/// <summary> /// Rotate the camera to the left /// </summary> /// <returns>True</returns> public bool rotateLeft() { int speed = 0; m.move(getOpenSpace()); Thread.Sleep(300); m.holdLeftButton(); Thread.Sleep(300); speed = m.Speed; m.Speed = ran.Next(2, 4); m.move(new Point(m.x - ran.Next(60, 100), ran.Next(m.y - 10, m.y)), 0, 0); Thread.Sleep(ran.Next(1500, 2000)); m.Speed = speed; pm.synchronize(m); m.releaseLeftButton(); return(true); }
/// <summary> /// Accept the currently open mission /// </summary> /// <returns>True on success, false otherwise</returns> public bool acceptMission() { InterfaceResponse iresp = (InterfaceResponse)com.sendCall(FunctionCallFactory.CALLS.GETAGENTMISSIONACCEPTBTN, Response.RESPONSES.INTERFACERESPONSE); if (iresp == null) { return(false); } m.move(new Point(ran.Next(iresp.X + 10, iresp.X + iresp.Width - 10), ran.Next(iresp.Y + 3, iresp.Y + iresp.Height - 3))); Thread.Sleep(ran.Next(300, 400)); m.click(true); pm.synchronize(m); return(true); }
/// <summary> /// Withdraw the given item stack from the station hangar by name /// </summary> /// <param name="name">Item name to withdraw</param> /// <returns>True on success, false otherwise</returns> public bool withdrawItem(string name) { if (!isItemInHangar(name)) { return(false); } ItemResponse items = (ItemResponse)com.sendCall(FunctionCallFactory.CALLS.GETHANGARITEMS, Response.RESPONSES.ITEMRESPONSE); if (items == null) { Console.WriteLine("cargolist is null"); return(false); } InterfaceResponse iresp = (InterfaceResponse)com.sendCall(FunctionCallFactory.CALLS.GETSHIPHANGAR, Response.RESPONSES.INTERFACERESPONSE); if (iresp == null) { Console.WriteLine("hangar is null"); return(false); } foreach (Item it in (List <Item>)items.Data) { if (it.Name.ToLower().Equals(name.ToLower())) { m.move(new Point(ran.Next(it.X + 5, it.X + it.Width - 5), ran.Next(it.Y + 5, it.Y + it.Height - 5))); Thread.Sleep(200); m.holdLeftButton(); Thread.Sleep(200); m.move(new Point(ran.Next(iresp.X + 5, iresp.X + iresp.Width - 5), ran.Next(iresp.Y + 5, iresp.Y + iresp.Height - 5))); Thread.Sleep(200); m.releaseLeftButton(); pm.synchronize(m); return(true); } } return(false); }
/// <summary> /// Begin scanning from the probe window /// </summary> public void probeScan() { InterfaceResponse iresp = (InterfaceResponse)com.sendCall(FunctionCallFactory.CALLS.GETANALYZEPROBESBUTTON, Response.RESPONSES.INTERFACERESPONSE); if (iresp == null) { return; } m.move(new Point(ran.Next(iresp.X + 5, iresp.X + iresp.Width - 5), ran.Next(iresp.Y + 5, iresp.Y + iresp.Height - 5))); Thread.Sleep(ran.Next(200, 300)); m.click(true); pm.synchronize(m); }