Introduction:
Hey guys, Well today I'm releasing my bot codes for RASTALULZ RP V26. As Caleb as released his, I thought that I may as well do mine.
[NOTE: I KNOW THESES ARE MESSY, BUT THESES WERE FOR PERSONAL USE, AND IF I SEE ,MANY WANTING THEM, THEN I'M HAPPY TOO CONTINUE TO DO WORK ON THEM!]
1) Open up virtualRooms.cs
2) Add this to your name space:
"using Holo.Virtual.Rooms.Pathfinding;" - With no quotes.
3) Then, Goto virtualUsers.CS and all the timevoids that are naccesible due to its protection level make it public, instead of private.
4) Search for;
"private string _publicroomItems;" - With no quotes.
5) Add this;
" public Thread follow;" - with no quotes.
6) Search for;
"internal void sendShout(virtualRoomUser sourceUser, string Message)"
7) ABOVE IT add this snippet;
8) Search for;Code:public void follower() { int iCount = 0; try { while (true) { using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient()) foreach (virtualBot roomBot in _Bots.Values) foreach (virtualRoomUser sourceUser in _Users.Values) { int punch_randomer; int slap_randomer; int dead; virtualUser Target = userManager.getUser(sourceUser.userID); punch_randomer = dbClient.getInt("SELECT punch FROM users WHERE id = '" + Target.userID + "'"); slap_randomer = dbClient.getInt("SELECT slap FROM users WHERE id = '" + Target.userID + "'"); dead = dbClient.getInt("SELECT dead FROM users WHERE id = '" + Target.userID + "'"); int cop = dbClient.getInt("SELECT cop FROM roombots WHERE figure = '" + roomBot.Figure + "'"); if (dead == 1) { sendShout(roomBot, "Cunt, Your dead, Il get you later, i guess!"); dbClient.runQuery("UPDATE users SET punch = '0' WHERE name = '" + Target._Username + "'"); follow = null; follow.Abort(); } else { if (punch_randomer == 1) { if (cop == 1) { iCount++; roomBot.Z1 = Rotation.Calculate(roomBot.X, roomBot.Y, Target.roomUser.X, Target.roomUser.Y); roomBot.Z2 = roomBot.Z1; Coord Next = new Coord(); int[] Borders = getMapBorders(); Next = new Coord(Target.roomUser.X - 1, Target.roomUser.Y); roomBot.goalX = Next.X; roomBot.goalY = Next.Y; Thread.Sleep(200); if ((roomBot.Y == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y + 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y - 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X + 1 == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X - 1 == Target.roomUser.X)) { Target.roomUser.walkLock = true; Target.roomUser.goalX = -1; Target.Run(); sendSaying(roomBot, "*fires a stungun at " + Target._Username + "*"); if ((roomBot.Y == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y + 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y - 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X + 1 == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X - 1 == Target.roomUser.X)) { iCount++; roomBot.Z1 = Rotation.Calculate(roomBot.X, roomBot.Y, Target.roomUser.X, Target.roomUser.Y); roomBot.Z2 = roomBot.Z1; Next = new Coord(Target.roomUser.X - 1, Target.roomUser.Y); roomBot.goalX = Next.X; roomBot.goalY = Next.Y; Thread.Sleep(2000); Target.roomUser.walkLock = true; sendSaying(roomBot, "*removes cuffs from belt and wraps around " + Target._Username + " wrists*"); Thread.Sleep(2000); sendSaying(roomBot, "*arrests " + Target._Username + " for 15 minutes, and fines them 75 credits, for assult!*"); dbClient.runQuery("UPDATE users SET credits = credits - '75' WHERE name = '" + Target._Username + "'"); Target.refreshValueables(true, true); dbClient.runQuery("UPDATE users SET arrested = '1', arrests = arrests + '1', time_jail = '15', working = '0' WHERE name = '" + Target._Username + "'"); Target._Figure = Target._Uni + "ch-220-94.lg-280-94.sh-290-94"; Target._Mission = "Convict"; Target.refreshAppearance(false, true, true); dbClient.runQuery("UPDATE users SET punch = '0' WHERE name = '" + Target._Username + "'"); dbClient.runQuery("UPDATE users SET avoid = '1' WHERE name = '" + Target._Username + "'"); Target.sendData("D^" + "H" + Encoding.encodeVL64(7)); ThreadStart jailStarter = new ThreadStart(Target.jailTime); Target.jailLooper = new Thread(jailStarter); Target.jailLooper.Priority = ThreadPriority.Lowest; Target.jailLooper.Start(); follow = null; follow.Abort(); } else if (slap_randomer == 1) { if (cop == 1) { iCount++; roomBot.Z1 = Rotation.Calculate(roomBot.X, roomBot.Y, Target.roomUser.X, Target.roomUser.Y); roomBot.Z2 = roomBot.Z1; Next = new Coord(Target.roomUser.X - 1, Target.roomUser.Y); roomBot.goalX = Next.X; roomBot.goalY = Next.Y; Thread.Sleep(200); if ((roomBot.Y == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y + 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y - 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X + 1 == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X - 1 == Target.roomUser.X)) { Target.roomUser.walkLock = true; Target.roomUser.goalX = -1; Target.Run(); sendSaying(roomBot, "*fires a stungun at " + Target._Username + "*"); if ((roomBot.Y == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y + 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y - 1 == Target.roomUser.Y && roomBot.X == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X + 1 == Target.roomUser.X) || (roomBot.Y == Target.roomUser.Y && roomBot.X - 1 == Target.roomUser.X)) { iCount++; roomBot.Z1 = Rotation.Calculate(roomBot.X, roomBot.Y, Target.roomUser.X, Target.roomUser.Y); roomBot.Z2 = roomBot.Z1; Next = new Coord(Target.roomUser.X - 1, Target.roomUser.Y); roomBot.goalX = Next.X; roomBot.goalY = Next.Y; Thread.Sleep(2000); Target.roomUser.walkLock = true; sendSaying(roomBot, "*removes cuffs from belt and wraps around " + Target._Username + " wrists*"); Thread.Sleep(2000); sendSaying(roomBot, "*arrests " + Target._Username + " for 5 minutes, and fines them 25 credits, for assult!*"); dbClient.runQuery("UPDATE users SET credits = credits - '25' WHERE name = '" + Target._Username + "'"); Target.refreshValueables(true, true); dbClient.runQuery("UPDATE users SET arrested = '1', arrests = arrests + '1', time_jail = '5', working = '0' WHERE name = '" + Target._Username + "'"); Target._Figure = Target._Uni + "ch-220-94.lg-280-94.sh-290-94"; Target._Mission = "Convict"; Target.refreshAppearance(false, true, true); dbClient.runQuery("UPDATE users SET slap = '0' WHERE name = '" + Target._Username + "'"); dbClient.runQuery("UPDATE users SET avoid = '1' WHERE name = '" + Target._Username + "'"); Target.sendData("D^" + "H" + Encoding.encodeVL64(7)); ThreadStart jailStarter = new ThreadStart(Target.jailTime); Target.jailLooper = new Thread(jailStarter); Target.jailLooper.Priority = ThreadPriority.Lowest; Target.jailLooper.Start(); follow = null; follow.Abort(); } } } } Thread.Sleep(300); } } } } } } } catch { Thread.CurrentThread.Abort(); follow = null; } }
" internal void sendShout(virtualRoomUser sourceUser, string Message)" - With no quotes.
9) Open up the void, if not already opened.
10) I CANNOT REMEMBER WHAT WAS IN THAT VOID, AS I DID THIS MONTHS BACK, BUT ADD THIS IN THE VOID IF YOU CAN;
Database collums:Code:virtualUser Target = userManager.getUser(sourceUser.userID); { int cop = dbClient.getInt("SELECT cop FROM roombots WHERE figure = '" + roomBot.Figure + "'"); int randomer = dbClient.getInt("SELECT punch FROM users WHERE id = '" + Target.userID + "'"); { if (follow != null) { } else { if (randomer == 1) { if (cop == 1) { sendShout(roomBot, "FREEZE LAPD!"); follow = new Thread(follower); follow.Priority = ThreadPriority.Lowest; follow.Start(); } }
This may sound stupid but I never worked out a different method..
Goto users table and add a collum for;
punch
int 1
defined 0
Goto roombots table, and add a collum for;
cop
int 1
defined 0
And on your punch command add this query;
" dbClient.runQuery("UPDATE users SET punch = '1' WHERE name = '" + _Username + "'");"
[NOTE] YOU MAY NEED TO ADD THAT ONTO YOUR RELEASE COMMANDS, AND ARREST, OR YOUR BOT MAY RE-ARREST THE USER.
SORRY FOR THE MESSY TUTORIAL BUT ITS 2:34 AM, AND I'M TIERD. (:
IF YOU LIKE THIS, THEN FEEL FREE TO SHOW YOUR APPRECIATION AND CLICK THE THANKS BUTTON (:.
- Cheers.


![[RP] Police Bot Function! [SLEDMORE]](http://ragezone.com/hyper728.png)


