SRL Archive - OSR Script Requests

[REQUEST] Who can help me finish/fix my Combat Ring script? [REQUEST 4 HELP]


Vowel

2015-04-01 14:53:58

Hi there, I've been trying to write this for like a week now, and I'm unable to finish it or have it actually do what it's supposed to do. I've been trying to get help on the forums and the IRC and while some people have tried to help me (mayor, elfyyy, tls, thank you) doesn't seem like anyone really wants to spend their time helping a noob, which sucks because there isn't much resources on the LAPE include.. when it runs it goes through the whole loop which it shouldn't be cause each function checks where my character is currently located and shouldn't move to the next function unless my character is in a new polygon.. Also, it doesn't click the combat ring like it should, I've tried 5-6 different functions and none work…

enterMainRing() and the rest of the enter functions are the two different functions i've tried using to click on the combat ring to enter are the most recent i've tried to no avail

SOMEONE PLEASE SAVE ME,

skype : vowelmachine



program combatRing;
{$DEFINE SMART}
{$i Reflection/Reflection.Simba}

var MyPlayer: TReflectLocalPlayer;

function mainOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10836], [11863, 10836], [11863, 10841], [11856, 10841]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;

function leftOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10842], [11857, 10842], [11857, 10845], [11856, 10845]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;

function rightOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10846], [11856, 10847], [11863, 10847], [11863, 10846]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;

function topOfRing(): boolean;
var
outsidePolygon: TPointArray;
begin
outsidePolygon := [[11856, 10846], [11856, 10847], [11863, 10847], [11863, 10846]];
result := Reflect.Tiles.InPolygon(outsidePolygon); // can shorten this to result :=
end;


function inRing(): boolean;
var
insidePolygon: TPointArray;
begin
insidePolygon := [[7447, 11802], [7447, 11802], [7447, 11802], [7447, 11802]];
result := Reflect.Tiles.InPolygon(insidePolygon);
end;

procedure enterMainRing();
var
combatRing: TReflectObject;
var tile : TTile;
var point : TPoint;
begin
writeLn('left ring');

begin // I added a begin..end here
tile := [7447, 11802];
wait(randomrange(43,95));
point := Reflect.Tiles.TileToMS(tile, 0, 0, 0);
Reflect.Mouse.Move(point, 3, 3, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;

procedure enterLeftRing();
var
combatRing: TReflectObject;
begin
writeLn('left ring');
if combatRing.Find(objGame, '13138', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;

procedure enterRightRing();
var
combatRing: TReflectObject;
begin
writeLn('right ring');
if combatRing.Find(objGame, '13140', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;

procedure enterTopRing();
var
combatRing: TReflectObject;
begin
writeLn('top ring');
if combatRing.Find(objGame, '13139', 40) then
begin // I added a begin..end here
wait(randomrange(43,95));
Reflect.Mouse.Move(combatRing.GetMSPoint, 2, 2, MOUSE_LEFT); // Can click at same time
while MyPlayer.IsMoving do
Wait(randomrange(900,1200));
end;
end;

procedure attackPlayer();
var
Player: TReflectPlayer;
begin
wait(500 + random(1097));
while not MyPlayer.IsUnderAttack do
begin
if Player.Find('removed') then
begin // added this begin here
Reflect.Mouse.Move(Player.GetMSPoint, 2, 2, MOUSE_LEFT);
wait(randomrange(50,150));
while MyPlayer.IsMoving do
Wait(randomrange(1000,1300));
end;
end;
end;

procedure loop();
begin
if mainOfRing() := true then
begin
enterMainRing;
end;

if leftOfRing() := true then
begin
enterLeftRing;
end;

if topOfRing() := true then
begin
enterTopRing;
end;

if rightOfRing() := true then
begin
enterRightRing;
end;

if inRing() := true then
begin
Wait(randomrange (120, 300));
attackPlayer;
end;
end;

begin
Reflect.Setup;
repeat
loop;
until(false);
end.


KeepBotting

2015-04-02 16:38:44

Change the title to say "REQUEST 5 HELP" because this is your 5th thread about the same topic

Vowel

2015-04-02 21:17:17

From: KeepBotting
Change the title to say "REQUEST 5 HELP" because this is your 5th thread about the same topic


Man, this community sux :/ I first made a thread for someone to make the script, no one wanted to so I tried writing it myself. So my other threads were trying to get help on functions, and now I'm requesting for someone to help finish what I started. But once again, I get people talking shit… I swear for a community which talks about revolving around helping one another learn everyone seems pretty hypocritical. Most replies are literally "this kids retarded" (core), "go take programming courses if you want to learn", etc.. Quite sad.. Even Powerbot has a more friendly and helpful community.

Only cool ones so far are Elfyyy, The mayor, Garret, TLS so if you see this thank you. To the rest of you, get off your high horse :)

AND RJ :D

Citrus

2015-04-02 22:06:36

I would be glad to help, but I only play and script for RS3 :(

edit: Try to figure out exactly which lines are causing problems, then it might be easier to get help

rj

2015-04-02 22:38:37

From: KeepBotting
Change the title to say "REQUEST 5 HELP" because this is your 5th thread about the same topic

Relevant


@OP In lsimba when you use := you are setting the value of something, example


myNumber := 5;

When you want to check to see if a value equals another, you use '='


if (myNumber = 5) then
writeln('Number is 5')


So all you have to do is change the := to =
procedure loop();
begin
if mainOfRing() = true then
begin
enterMainRing;
end;

if leftOfRing() = true then
begin
enterLeftRing;
end;

if topOfRing() = true then
begin
enterTopRing;
end;

if rightOfRing() = true then
begin
enterRightRing;
end;

if inRing() = true then
begin
Wait(randomrange (120, 300));
attackPlayer;
end;
end;

Vowel

2015-04-02 23:08:51

From: rj
Relevant


@OP In lsimba when you use := you are setting the value of something, example


myNumber := 5;

When you want to check to see if a value equals another, you use '='


if (myNumber = 5) then
writeln('Number is 5')


So all you have to do is change the := to =
procedure loop();
begin
if mainOfRing() = true then
begin
enterMainRing;
end;

if leftOfRing() = true then
begin
enterLeftRing;
end;

if topOfRing() = true then
begin
enterTopRing;
end;

if rightOfRing() = true then
begin
enterRightRing;
end;

if inRing() = true then
begin
Wait(randomrange (120, 300));
attackPlayer;
end;
end;


lmao, ty. you're beautiful

Turpinator

2015-04-03 00:35:43

From: Vowel
"go take programming courses if you want to learn"

True statement.

http://www.codecademy.com/tracks/python
The functions are going to be different, but to code you really just need the knowledge of how to code logically.


outsidePolygon := [[11856, 10836], [11863, 10836], [11863, 10841], [11856, 10841]];
This looks like a square/box to me.
result := PointInBox(Reflect.Tiles.GetGlobalTile, IntToBox(11856, 10841, 11863, 10836))[simba]
etc.

InRing's box/etc is a single point. Top and Right are the same areas.

Justin

2015-04-03 00:38:00

Removed display name from script.