SRL Archive - OSR Help

Dds spec using DTM and Bitmap ERROR.


humeruzz

2013-09-26 18:47:48

So basicly i'm trying to create my first bitmap and DTM script usage..
And what it's suppose to be used for is just use the dds spec.

So, what i set it to do was to find the bitmap where it said "Your special attack is now 100.0%" in the chatbox (meaning i'd have to use atleast 1 spec before starting the script).
And from there on use a DTM for the Dragon dagger and then type in key "f5" (which i'm not sure i did correct either).

Click the spec and return to the inventory.
I still haven't added the last part going back and wielding the other weapon (whip)…


The error I get is:
[Error] C:\Simba\Scripts\UseDDS.simba(12:60): Type mismatch at line 12
Compiling failed.



And to be honest, I have 0% idea on what to do…




Program UseDDS;
{$i srl/srl.simba}
var
X, Y, FindSpec, dds: Integer;
Procedure Spec;

var
X,Y: Integer;

begin
if FindBitmapToleranceIn(Spec, X, Y, 7, 437, 365, 462, 50) then
begin;
dds;
end;
end;
Begin
FindSpec := BitmapFromString(144, 7, 'meJyNlrGOgzAMhnl/MWZk7XLSdW' +
'BgiESXSnSoxMjYZ7nETpzfduCKIuQY41B//Z2EeQswpmUL9zXftT8' +
'5h2FI/ikq/zjbyBQmqdJIU4kx75aYuLfB68Y9r4X+uId6D8vOMf5p' +
'GY9jojDjDzANvcwYE2qe/CXPI/+o55GdZKf7jcZAl9i318f7k3Oie' +
'wsgu0zZLxnoaXO+y0IywrxiqTuk9FNfc8OXeY3AC9AUOu1dXz211u' +
'4HJzx7+uVAKGp1nBIvWTTVPD1NTrbZaEWGaht/QXAW0OOF7/6+FC8' +
'GPRZq6V6KP9RrNLyWzSDmy3tMHkGmXoGCYB7RVxecVHuAq1PhGmBw' +
'G2detAJqNo3boy0kfNnm0glKDw7l9g9QkZvOQ/r6ZF7vlidr4WdlB' +
'FQuMZReWCkirvEkzDjNVMmtsdhqNTZpR60UroPlDEurc4id9oikAk' +
'S2soMtRrFJRCpbZTSJviomNiwmU3aiNl0EOKaID2EBL7v14F+3C8K' +
'oCbEm6NwPPS/UlxKRbB+5+Bs+DQ5E3sJoFzNfaMIUBSMlB5GnCBT/' +
'KkwH9aU+/vEVDgxIqrkKwP6JTfX1yYK6r4ys1JyOFrXIzUaneMZZs' +
'UYFXctNIo2OWGhSvRDt2aA4KyA+gXhknleI29Brg56XvKgWpa0tgH' +
'Jxa5uqKPhMUrolcTRbj22PbqoM3VF9P0RRcPe70Ffjde9hjV5ftbB' +
'xL7zi3mKcOrCquGeVMi7KyRkE2Zm+vuJVTx3Yn4WX6aWBoODREbtl' +
'6aLPQ5hO0Bs77GgvUxtiPVKy8QdbCH1v');
FindSpec;
End;




procedure loadDTMs;
begin
writeln('loading DTMs')
dds := DTMFromString('m1gAAAHic42JgYOAAYl4o5obymRgggBGIWYCYCyrHCcRsUDl2qB5RIJaA0vxA7MvBBNWJHxsBSWIwYZMgGAEARekDLg==');
writeln('DTMs loaded!')
end;


Procedure Dds;

var
dds: Integer;

Begin;

If findDTM(dds, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin;
MMouse(x, y, 1,1)
If IsUpText('agge') Then
Mouse(x, y, 0, 0, true);
Sleep(100)
begin
KeyDown(116);
wait(RandomRange(20, 30));
KeyUp(116);
Sleep(100+random(50))
Begin;
MMouse(628, 424)
wait(50)
ClickMouse(X, Y, mouse_Left)
Begin;
KeyDown(112);
wait(RandomRange(20, 30));
KeyUp(112);
End;
End;
end;
End;

FreeDTM(dds);
End;]


I am a complete ROOKIE to coding (well… sorta.. yea.. :P )
But I enjoy it, and I enjoyed the challange until this happened.



PS:
The server this is for is SoulSplit RSPS.
It's an older revision and blah blah blah…
So I am trying to implement this part of the script into another fighting script which can be found here:
http://villavu.com/forum/showthread.php?t=105121






Thank you for your time,
It's currently 00:46 here.. So I am not sure if my grammar is good, and if the above is making ANY sense..
I just want to go to bed and continue tomorrow :)


Regards,
Humeruzz

YoHoJo

2013-09-26 18:52:17

First of all you have a global variable called DDS and a procedure called DDS, I don't think you can do that (maybe?).

2nd, you are calling the DDS procedure in line 12 BEFORE you even have the DDS procedure.

So copy/pate the DDS procedure above the Spec procedure and you should be good.

riwu

2013-09-26 18:57:15

You passed a procedure as the first argument to FindBitmapToleranceIn(). It accepts an integer representing the bitmap in memory, which is FindSpec in this case.

humeruzz

2013-09-26 19:13:50

From: YoHoJo
First of all you have a global variable called DDS and a procedure called DDS, I don't think you can do that (maybe?).

2nd, you are calling the DDS procedure in line 12 BEFORE you even have the DDS procedure.

So copy/pate the DDS procedure above the Spec procedure and you should be good.



Did it. :)
But new error @ line 53.
[Error] C:\Simba\Scripts\UseDDS.simba(53:60): Type mismatch at line 53
Compiling failed.


I marked line 53 so you can find it easier :)
If you want to help ofc




Program UseDDS;
{$i srl/srl.simba}
var
X, Y, FindSpec, dds: Integer;


Procedure Ddagger;

var
dds: Integer;

Begin;

If findDTM(dds, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin;
MMouse(x, y, 1,1)
If IsUpText('agge') Then
Mouse(x, y, 0, 0, true);
Sleep(100)
begin
KeyDown(116);
wait(RandomRange(20, 30));
KeyUp(116);
Sleep(100+random(50))
Begin;
MoveMouse(628, 424)
wait(50)
ClickMouse(628, 424, 1)
Begin;
KeyDown(112);
wait(RandomRange(20, 30));
KeyUp(112);
End;
End;
end;
End;

FreeDTM(dds);
End;






Procedure Spec;

var
X,Y: Integer;

begin
if FindBitmapToleranceIn(Spec, X, Y, 7, 437, 365, 462, 50) then
begin; //line 53 :(
Ddagger;
end;
end;
Begin
FindSpec := BitmapFromString(144, 7, 'meJyNlrGOgzAMhnl/MWZk7XLSdW' +
'BgiESXSnSoxMjYZ7nETpzfduCKIuQY41B//Z2EeQswpmUL9zXftT8' +
'5h2FI/ikq/zjbyBQmqdJIU4kx75aYuLfB68Y9r4X+uId6D8vOMf5p' +
'GY9jojDjDzANvcwYE2qe/CXPI/+o55GdZKf7jcZAl9i318f7k3Oie' +
'wsgu0zZLxnoaXO+y0IywrxiqTuk9FNfc8OXeY3AC9AUOu1dXz211u' +
'4HJzx7+uVAKGp1nBIvWTTVPD1NTrbZaEWGaht/QXAW0OOF7/6+FC8' +
'GPRZq6V6KP9RrNLyWzSDmy3tMHkGmXoGCYB7RVxecVHuAq1PhGmBw' +
'G2detAJqNo3boy0kfNnm0glKDw7l9g9QkZvOQ/r6ZF7vlidr4WdlB' +
'FQuMZReWCkirvEkzDjNVMmtsdhqNTZpR60UroPlDEurc4id9oikAk' +
'S2soMtRrFJRCpbZTSJviomNiwmU3aiNl0EOKaID2EBL7v14F+3C8K' +
'oCbEm6NwPPS/UlxKRbB+5+Bs+DQ5E3sJoFzNfaMIUBSMlB5GnCBT/' +
'KkwH9aU+/vEVDgxIqrkKwP6JTfX1yYK6r4ys1JyOFrXIzUaneMZZs' +
'UYFXctNIo2OWGhSvRDt2aA4KyA+gXhknleI29Brg56XvKgWpa0tgH' +
'Jxa5uqKPhMUrolcTRbj22PbqoM3VF9P0RRcPe70Ffjde9hjV5ftbB' +
'xL7zi3mKcOrCquGeVMi7KyRkE2Zm+vuJVTx3Yn4WX6aWBoODREbtl' +
'6aLPQ5hO0Bs77GgvUxtiPVKy8QdbCH1v');
FindSpec;
End;




procedure loadDTMs;
begin
writeln('loading DTMs')
dds := DTMFromString('m1gAAAHic42JgYOAAYl4o5obymRgggBGIWYCYCyrHCcRsUDl2qB5RIJaA0vxA7MvBBNWJHxsBSWIwYZMgGAEARekDLg==');
writeln('DTMs loaded!')
end;


YoHoJo

2013-09-26 19:22:44

remove the ; after the begin

humeruzz

2013-09-27 01:07:38

From: YoHoJo
remove the ; after the begin


It didn't do anything.
Any other suggestions?

I'm browsing the forums to look for answers, but I can't seem to find much working.

Sjoe

2013-09-27 01:21:03

From: humeruzz
It didn't do anything.
Any other suggestions?

I'm browsing the forums to look for answers, but I can't seem to find much working.


u got multiple begin; remove the semicolon on all of them.

humeruzz

2013-09-27 08:36:32

From: Sjoe
u got multiple begin; remove the semicolon on all of them.


@school right now, i'll try it when I come home :)
Thanks for another answer :D