SMARTv8.2
BenLand100
2013-07-17 00:01:39
Don't let the minor version bump confuse you - there is a lot of good stuff in this update. This includes bugfixes for many old bugs and is far more stable, plus opens up ogl color botting among other things. This is the stable SMART that will be going in the Simba plugin updater.
OpenGL/DirectX PluginsI've decided to add a plugin system to SMART that basically lets other devs extend the usefullness of SMART beyond simple SafeMode graphics. Specifically, Brandon has been working tirelessly on an OpenGL based plugin, and now you can EASILY load that into SMART to capture colors (or whatever else) and return it to Simba.
(once he gets his plugin finished, that is) Brandon's excellent plugin (still beta) for SMART can be found here. These plugins, which can be written by anyone using the api (see github), interact well with SMART and require no further modification of a script to use, besides passing the name of the plugin to SMART at spawn. Plugins can even change the buttons on the front panel of SMART to interact with the user.
ReflectionFor you old-school RS folks, reflection is back using the newer out-of-process SMART functionality and pairing. The reflection API is the same as it was, so revive those old includes and get to work.
Supposedly old reflection devs are working on a reboot.Java 7SMART is now built natively with Java 7, and includes all necessary bugfixes to make it play nice.
Make sure Java 7 binaries are on your system's path. ScrollMouseSMART exports both EIOS and regular scrolling methods, so you can now scroll your fake SMART mouse.
Notable Changes- Extra argument to SmartSpawnClient (meaning you need to change that call in SRL to work with new SMART until devs get SRL updated) to accept a list of plugins for SMART to load. The call should look something like this if you are not using plugins, but tailor it to your own preferences (note the LAST argument)
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
Capture Enable/Disable now controls the internal SafeMode/Software color scraping, and the default UI buttons have been changed a bit. Keep in mind that using the ogl plugins modifies the front panel significantly.SMARTSetNativeButton(plugid,btnid:integer; state:boolean); allows Simba to interact with buttons defined by native plugins (plugid is the index of the plugin as passed to smart, btnid is defined by the plugin).Bugfixes- TypeThrough should now be flawless with improved internal logic & Java7 along with no grabbing of focus.
- ImageTransfer logic was slightly broken resulting in other bugs, now fixed.
- Sleeper bug in MoveMouse would not allow other events if mouse was on top or left edge
- Includes better code to clean up SMART.PID files
- SMARTGetFieldArray3DDouble and SmartGetFieldArray2DFloat improperly exported, results in failure to import the pluign in lape, and the functions being unavaliable/collided in pascalscript, now properly exported.
- SMART would crash the JVM on some windows distributions on close, now exits cleanly.
- Plugins needed some way to have buttons on front panel
- Tab press on restore causing "quick response" to open fixed
- Sleeper bug loading main applet, but never previously an issue, and never will be.
NOTE: Due to the drastic changes within, this version is likely to be short lived as bugs are fixed, but please test it well and let me know what problems are found. (version 8.2 is stable)
Verson 8.2 now has all final bug fixes and will be included in Simba plugins package.
About:
bland.no-ip.org/index.php/SMARTSource:
https://github.com/BenLand100/SMARTOfficial Binaries: [ATTACH]21955[/ATTACH]
tl;dr things likely to cause problems, or are otherwise important, are in red. Don't ignore them.
Kevin
2013-07-17 00:07:32
Oh wow. Damn man, good job! It's always awesome to see your work - especially with such a huge list of additions! :D
YoHoJo
2013-07-17 00:15:08
From: BenLand100
Reflection
For you old-school RS folks, reflection is back using the newer out-of-process SMART functionality and pairing. The reflection API is the same as it was, so revive those old includes and get to work.
[ATTACH=CONFIG]21912[/ATTACH]
Silentcore
2013-07-17 00:17:20
Another wornderful Job by the SMART guy. Keep the good work up! Thanks!
The Mayor
2013-07-17 00:19:31
So is this Brandon's SMART 8.1? Or are they completely different?
mormonman
2013-07-17 00:32:45
It's. About. Damn. Time.
Jokes, nice release.
Justin
2013-07-17 00:34:30
Nice work BenLand and everyone else who has worked on this
Ashaman88
2013-07-17 00:35:16
Sweet!
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
BenLand100
2013-07-17 01:19:10
From: The Mayor
So is this Brandon's SMART 8.1? Or are they completely different?
Completely different, though Brandon contributed code to this release. He is modifying his plugins to use the new plugin system so they will work without the need to modify SMART specifically for a OpenGL and such.
The Mayor
2013-07-17 01:33:09
From: BenLand100
Completely different, though Brandon contributed code to this release. He is modifying his plugins to use the new plugin system so they will work without the need to modify SMART specifically for a OpenGL and such.
Awesome! Things should be easier to install now.
Chris!
2013-07-17 01:59:47
Great release, Benland. Looks sweet.
Flight
2013-07-17 02:04:40
This is great to see, wonderful job to both of you. :thumbsup:
Sweet! Thanks for this :)
From: YoHoJo
[ATTACH=CONFIG]21912[/ATTACH]
My thoughts exactly. Nice job Ben!
EDIT:
https://github.com/SRL/SRL-Reflection-2 Is this the latest reflection revision?
Flight
2013-07-17 07:12:19
From: Rich
My thoughts exactly. Nice job Ben!
EDIT: https://github.com/SRL/SRL-Reflection-2
Is this the latest reflection revision?
Yes 'tis but because that library is for a much later version of RS I imagine much of it not being compatible.
From: Flight
Yes 'tis but because that library is for a much later version of RS I imagine much of it not being compatible.
True, but with a bit of work we can adapt what we've got. And I assume you mean earlier?
Flight
2013-07-17 08:44:55
From: Rich
True, but with a bit of work we can adapt what we've got. And I assume you mean earlier?
No indeed it's later. Reflection V2 was still in development when the clusterflutter hit, which I believe was October 2011? While we'll be using reflection for the 2007 version of Runescape, so some of what's in the Ref.2 library will not yet exist in Oldschool.
From: Flight
No indeed it's later. Reflection V2 was still in development when the clusterflutter hit, which I believe was October 2011? While we'll be using reflection for the 2007 version of Runescape, so some of what's in the Ref.2 library will not yet exist in Oldschool.
Good point. Ignore me, I was having a bit of a moment there…
Brandon
2013-07-17 12:54:45
@Flight; Play around with this.. for oldschool.
{$DEFINE SMART}
{$I SRL/SRL.Simba}
type TTile = record
X, Y: Integer;
end;
Function R_IsMenuOpen: Boolean;
Begin
Result := SmartGetFieldBoolean(0, 'client.hw');
End;
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
function R_GetCamPosX: integer;
begin
Result := SmartGetFieldInt(0, 'ca.fh') * 1600266873;
end;
function R_GetCamPosY: integer;
begin
Result := SmartGetFieldInt(0, 'l.ft') * 1750131833;
end;
function R_GetCamPosZ: integer;
begin
Result := SmartGetFieldInt(0, 'fq.fb') * -1357036389;
end;
begin
SetupSRL;
ClearDebug;
end.
Also, can someone tell me if the tilde key works for them? It should bring up the developer console but for me it types a dot instead.
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(282:145): Type mismatch at line 281
Compiling failed.
:(
From: Sjoe
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(282:145): Type mismatch at line 281
Compiling failed.
:(
Still gotta define smart8.
From: Olly
Still gotta define smart8.
I did, gonna try a re-install. might be of the brandon files.
From: Sjoe
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(282:145): Type mismatch at line 281
Compiling failed.
:(
Same happened for me. Defined SMART 8 and did a fresh install as well. Still the same.
From: Brandon
@Flight; Play around with this.. for oldschool.
{$DEFINE SMART}
{$I SRL/SRL.Simba}
type TTile = record
X, Y: Integer;
end;
Function R_IsMenuOpen: Boolean;
Begin
Result := SmartGetFieldBoolean(0, 'client.hw');
End;
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
function R_GetCamPosX: integer;
begin
Result := SmartGetFieldInt(0, 'ca.fh') * 1600266873;
end;
function R_GetCamPosY: integer;
begin
Result := SmartGetFieldInt(0, 'l.ft') * 1750131833;
end;
function R_GetCamPosZ: integer;
begin
Result := SmartGetFieldInt(0, 'fq.fb') * -1357036389;
end;
begin
SetupSRL;
ClearDebug;
end.
Also, can someone tell me if the tilde key works for them? It should bring up the developer console but for me it types a dot instead.
all of those functions worked for me except for the menu always returns false, what is defined as a menu?
Brandon
2013-07-17 13:34:29
Damn guys..
var
Smart_Plugins, InitSeq: String;
if (Length(Smart_Plugins) > 0) then
InitSeq := ''
else
InitSeq := 's';
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, InitSeq, '', '', Smart_Plugins);
Or just simply do:
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
if you don't plan on using the plugin system.
A menu is when you do:
MMouse(250, 250, 0, 0);
ClickMouse2(MOUSE_RIGHT);
writeln(R_IsMenuOpen);
From: Brandon
Damn guys..
var
Smart_Plugins, InitSeq: String;
if (Length(Smart_Plugins) > 0) then
InitSeq := ''
else
InitSeq := 's';
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, InitSeq, '', '', Smart_Plugins);
Or just simply do:
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
if you don't plan on using the plugin system.
A menu is when you do:
MMouse(250, 250, 0, 0);
ClickMouse2(MOUSE_RIGHT);
writeln(R_IsMenuOpen);
Ahh ok,
djborec
2013-07-17 18:17:17
Reflection :spot:
Seems great ,just few days and include will be again fully working I guess. With reflecion randoms will be easy to do . :)
Any plans for that auto updater, or is it up to the script writers to put the fields in themselves?
Flight
2013-07-17 20:44:21
Alright Brandon I'll give that a go. Where did you get your hooks by the way? Yesterday I dropped Pyroryan a line to give me a crash course on determining client hooks but that was only yesterday so no reply back yet.
Edit:
Yep that seems to work just fine.
From: Flight
Alright Brandon I'll give that a go. Where did you get your hooks by the way? Yesterday I dropped Pyroryan a line to give me a crash course on determining client hooks but that was only yesterday so no reply back yet.
he used updater logs
(Showing off E-Peen here)
like this one:
[ Canvas ]
^ bp extends java/awt/Canvas
+ replaced Canvas with RSCanvas
[ Node ]
^ fk extends java/lang/Object
[ CacheableNode ]
^ fn extends fk
[ CacheableNodeQueue ]
^ fz extends java/lang/Object
[ NodeHashTable ]
^ fs extends java/lang/Object
[ NodeQueue ]
^ fk extends java/lang/Object
[ NodeQueue ]
^ fg extends java/lang/Object
[ NodeCache ]
^ fu extends java/lang/Object
[ Renderable ]
^ cg extends fn
[ Actor ]
^ as extends cg
[ Model ]
^ dw extends cg
[ Player ]
^ d extends as
* getDefinition() -> Lfx; d.m
Created normal method getDefinition returns ()Lorg/pulsebot/injection/interfaces/IPlayerDefinition;
* getName() -> Ljava/lang/String; d.y
Created normal method getName returns ()Ljava/lang/String;
* getModel() -> Ldw; d.r
[ PlayerDefinition ]
^ fx extends java/lang/Object
[ NPC ]
^ g extends as
* getDefinition() -> Lav; g.y
Created normal method getDefinition returns ()Lorg/pulsebot/injection/interfaces/INPCDefinition;
[ NPCDefinition ]
^ av extends fn
* getName() -> Ljava/lang/String; av.s
Created normal method getName returns ()Ljava/lang/String;
[ Client ]
^ client extends bs
* getNPCs() -> [Lg; client.bs
Created static method getNPCs returns ()[Lorg/pulsebot/injection/interfaces/INPC;
* getPlayers() -> [Ld; client.ga
Created static method getPlayers returns ()[Lorg/pulsebot/injection/interfaces/IPlayer;
* getYaw() -> dq.fw * -1896216087
[ GameShell ]
^ bs extends java/applet/Applet
Can find more here:
http://javahacking.org/forum/index.php?/forum/49-updater-logs/
BenLand100
2013-07-17 21:29:37
From: NKN
Any plans for that auto updater, or is it up to the script writers to put the fields in themselves?
There isn't an auto updater at all, so my best guess would be no plans.
From: BenLand100
There isn't an auto updater at all, so my best guess would be no plans.
I might make one
depends if
@Brandon wants to let me piggyback
Le Jingle
2013-07-18 00:31:11
Cool beans @BenLand100, thank you.
Thank you in addition to plugin developers too, ex. @Brandon, @Kasi, and possibly more. :)
Anyone want to show me the basics of OGL so I could edit: get it working*? thru tv or skype? :)
Much appreciated!
Thanks for the great work!
Bug:
after playing with the GUI a few times ('Enable/Disable Smart, Enable/Hide Graphics' etc), 'Enable SMART' resulted in the Graphic being hidden instead.
xtrapsp
2013-07-19 09:19:14
I'm with Sjoe, anyone wanna write some OGL tutorials?
Ashaman88
2013-07-19 09:21:27
From: xtrapsp
I'm with Sjoe, anyone wanna write some OGL tutorials?
I think Brandon is still writing the OGL plugin for this version of smart
xtrapsp
2013-07-19 09:23:24
From: Ashaman88
I think Brandon is still writing the OGL plugin for this version of smart
Ahh ok, in that case I suppose I could use an older version to learn.
Or will it be different?
Ashaman88
2013-07-19 09:25:35
From: xtrapsp
Ahh ok, in that case I suppose I could use an older version to learn.
Or will it be different?
I'm guessing the functions and stuff will be the same, but you'd have to confirm with Brandon. If you want to use it right now, you'd have to use Brandon's custom smart.
xtrapsp
2013-07-19 09:27:25
From: Ashaman88
I'm guessing the functions and stuff will be the same, but you'd have to confirm with Brandon. If you want to use it right now, you'd have to use Brandon's custom smart.
Ok, Thanks Ash :)
Brandon
2013-07-19 10:19:55
From: Ashaman88
I'm guessing the functions and stuff will be the same, but you'd have to confirm with Brandon. If you want to use it right now, you'd have to use Brandon's custom smart.
The old plugins do work with this Smart. Only different is that you have to manually type GLHSetup and stuff like that. New plugins Smart calls an initprocedure and gives it a buffer so there is no setup required.
Ashaman88
2013-07-19 10:32:12
From: Brandon
The old plugins do work with this Smart. Only different is that you have to manually type GLHSetup and stuff like that. New plugins Smart calls an initprocedure and gives it a buffer so there is no setup required.
Oops then ignore me :)
footballjds
2013-07-19 11:48:30
can i get some clarity on this reflection thing? it is only for OSRS correct?
Brandon's BA opengl stuff, that is for rs2/rs3, correct?
I'm outtta the loop :/
Flight
2013-07-19 12:07:41
From: footballjds
can i get some clarity on this reflection thing? it is only for OSRS correct?
Brandon's BA opengl stuff, that is for rs2/rs3, correct?
I'm outtta the loop :/
You nailed it.
footballjds
2013-07-19 13:35:33
From: Flight
You nailed it.
thanks, i like your sig:
"It is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring."
Flight
2013-07-19 20:49:35
From: footballjds
thanks, i like your sig:
"It is far better to grasp the Universe as it really is than to persist in delusion, however satisfying and reassuring."
Thank you. :) I've strong faith in following facts and science as opposed to stories written in a book, but 'tis just me; to each their own, no?
To make this post not so spammy, Brandon or NKN: do either of you two have plans of writing an updater for obtaining hooks for the reflection branch of this?
From: Flight
Thank you. :) I've strong faith in following facts and science as opposed to stories written in a book, but 'tis just me; to each their own, no?
To make this post not so spammy, Brandon or NKN: do either of you two have plans of writing an updater for obtaining hooks for the reflection branch of this?
NKN said he planned to in the Skype chat.
BenLand100
2013-07-20 03:45:16
From: BMWxi
NKN said he planned to in the Skype chat.
Planning to and being capable are two entirely different things.
speedster
2013-07-20 05:20:51
This version is awesome! :) Now just waiting for Brandon to do some of his magic and release the plugin ;)
Gj guys!
VirgilMH
2013-07-20 06:15:22
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(281:149): Invalid number of parameters at line 280
Compiling failed.
can anyone help ? ;\
smart8 is defined… an then this comes up after
anth_
2013-07-20 07:09:06
Wowee! A new SMART appeared!
Thank you BenLand! :)
kriss1993
2013-07-20 07:46:56
are there any tutorials how to setup it? cus just replacing to plugins doesent work since u have to have specific smart parms in includes
From: BenLand100
Planning to and being capable are two entirely different things.
############################################################
# Updater #
############################################################
# Node - fk #
#----------------------------------------------------------#
# next - fk.em #
# previous - fk.di #
# id - fk.dz #
############################################################
# CacheableNode - fn #
#----------------------------------------------------------#
# next - fn.cp #
# previous - fn.co #
############################################################
# LinkedList - fg #
############################################################
# PlayerComposite - fx #
#----------------------------------------------------------#
# female - fx.d #
# equipment - fx.m #
############################################################
# Model - dw #
#----------------------------------------------------------#
# verticesZ - dw.b #
# verticesX - dw.s #
# verticesY - dw.x #
# indicesX - dw.p #
# indicesY - dw.l #
# indicesZ - dw.i #
############################################################
# Player - d #
#----------------------------------------------------------#
# composite - d.m #
# name - d.y #
# model - d.r #
# combatLevel - d.v(-331795885) #
# skullIcon - d.k(680564603) #
# prayerIcon - d.d(-331014125) #
# totalLevel - d.s(-105857157) #
############################################################
# Stream - dp #
#----------------------------------------------------------#
# offset - dp.n(-1697142721) #
# payload - dp.k #
############################################################
# HashTable - fs #
#----------------------------------------------------------#
# buckets - fs.m #
# size - fs.y #
############################################################
# Queue - fz #
#----------------------------------------------------------#
# head - fz.y #
############################################################
# Cache - fu #
#----------------------------------------------------------#
# remaining - fu.d #
# hashTable - fu.k #
# emptyCacheableNode - fu.y #
# queue - fu.n #
# size - fu.m #
############################################################
# GenericComposite - aq #
#----------------------------------------------------------#
# projectileMoving - aq.i #
############################################################
# InterfaceNode - k #
#----------------------------------------------------------#
# modelId - k.d #
############################################################
# Interface - fi #
#----------------------------------------------------------#
# actions - fi.bs #
# id - fi.o(1359690359) #
# width - fi.v(-573812283) #
# height - fi.w(258121965) #
# relativeX - fi.u(99091979) #
# relativeY - fi.x(-559211941) #
# textureId - fi.ac(1751880407) #
# y - fi.y(-438126995) #
# x - fi.af(329286141) #
# parentId - fi.h(207084995) #
# parent - fi.ba #
# children - fi.dg #
# dynamicValueIndices - fi.dt #
# borderThickness - fi.ao(-65377649) #
# inventorySlotIds - fi.db #
# inventoryStackSizes - fi.dm #
# text - fi.bq #
# hidden - fi.aa #
# staticPosition - fi.dp(-12310965) #
# toolTip - fi.da #
# index - fi.c(920826089) #
# scrollX - fi.g(652002735) #
# scrollY - fi.e(-327656757) #
############################################################
# Actor - as #
#----------------------------------------------------------#
# animation - as.ay(-1297342091) #
# overheadText - as.am #
# x - as.z(-344898115) #
# y - as.v(-331795885) #
# orientation - as.bf(-1984513445) #
# loopCycle - as.ah(-10790807) #
############################################################
# NpcComposite - av #
#----------------------------------------------------------#
# name - av.s #
# actions - av.v #
# modelIds - av.av #
############################################################
# Npc - g #
#----------------------------------------------------------#
# composite - g.y #
############################################################
# Client - client #
#----------------------------------------------------------#
# tileBarriers - client.db #
############################################################
# Found 66 fields. #
# Found 17 interfaces. #
############################################################
# Analyse Time: 402.35ms #
############################################################
Leggo mate
Wu-Tang Clan
2013-07-20 11:38:12
Does this get the same CPU usage as 8.0? Because I wasn't getting as good of specs from 8.0 as 7.2
BenLand100
2013-07-20 13:04:18
From: NKN
Leggo mate
Whose updated did you steal this from, though? ;)
From: BenLand100
Whose updated did you steal this from, though? ;)
Hes got a legit updater I think :p
From: BenLand100
Whose updated did you steal this from, though? ;)
New guy we hired for PulseBot yesterday.
He's good @ this stuff lol.
@J J and myself are programming the client/helping with the updater if he needs it.
Is this taking anyone else like 10 minutes it pop up?
From: BenLand100
Whose updated did you steal this from, though? ;)
We have a good idea what we are doing with identifying the classes. Building up a Tree hierarchy and identifying classes based on earlier found classes etc.
Finding the correct fields on a way that it will be able to auto update with newer revisions is still a challenge. We have hooked a couple fields though. I've looked through the source code of the new guy that is developing with us.. some things look stable but most seems specifically aimed for Rev 16.
I've got the whole summer holiday to learn though. Perhaps there will be more experienced developers joining our dev team later.
n3ss3s
2013-07-20 20:30:37
From: NKN
New guy we hired for PulseBot yesterday.
He's good @ this stuff lol.
@J J and myself are programming the client/helping with the updater if he needs it.
Don't give up and delegate your job to the chinese
Finding the correct fields on a way that it will be able to auto update with newer revisions is still a challenge. We have hooked a couple fields though. I've looked through the source code of the new guy that is developing with us.. some things look stable but most seems specifically aimed for Rev 16.
http://javahacking.org/resources/2007client/There you go, don't go to sleep until nothing breaks between 1 and 16 :p
From: n3ss3s
Don't give up and delegate your job to the chinese
http://javahacking.org/resources/2007client/
There you go, don't go to sleep until nothing breaks between 1 and 16 :p
Easier said than done.
I'm pretty bad at this. Dunno how. :3
betterwork
2013-07-21 21:43:23
i overwrited the files in the plugins and have this error
[Error] C:\Simba\Includes\SRL-OSR/SRL/misc/SmartParams.Simba(229:203): Invalid number of parameters at line 228
Compiling failed.
From: betterwork
i overwrited the files in the plugins and have this error
[Error] C:\Simba\Includes\SRL-OSR/SRL/misc/SmartParams.Simba(229:203): Invalid number of parameters at line 228
Compiling failed.
Add an extra ' ' in the smart params I think
BenLand100
2013-07-22 16:39:39
Fixed some bugs, added some things, compiled, uploaded v8.1rev2
I'll probably, once this is stablilized, simply release it as v8.2 to avoid confusion with various unofficial SMARTs using v8.1 and also to have a nice clean version string.
From: BenLand100
Fixed some bugs, added some things, compiled, uploaded v8.1rev2
I'll probably, once this is stablilized, simply release it as v8.2 to avoid confusion with various unofficial SMARTs using v8.1 and also to have a nice clean version string.
Can we have a way to make it read a modscript, or do we have to write that and push it?
BenLand100
2013-07-22 21:31:52
From: NKN
Can we have a way to make it read a modscript, or do we have to write that and push it?
Something tells me this is unrelated to SMART. Mostly because I have no idea what it means. BUT, Brandon did, and he tells me you want a way to update paths. So I was right, nothing to do with SMART itself. I believe Simba has plenty of features to read files… right? Maybe make a thread about this somewhere more appropriate?
From: BenLand100
Something tells me this is unrelated to SMART. Mostly because I have no idea what it means. BUT, Brandon did, and he tells me you want a way to update paths. So I was right, nothing to do with SMART itself. I believe Simba has plenty of features to read files… right? Maybe make a thread about this somewhere more appropriate?
Hooks stored simba
gotcha
Brandon
2013-07-22 22:12:07
From: NKN
Hooks stored simba
gotcha
NKN He means that you can just have Simba read the hooks from wherever you stored them because in the end, Simba still has to pass them to Smart. Smart never reads anything directly. Always through a controller.
For example the old reflection hooks looked like:
https://github.com/SRL/SRL-Reflection-2/blob/master/lib/core/hooks.simbaAnd Simba functions would look up: hook_static_LoginIndex for example.. and use that automatically. Nothing special. Just join
#SRLReflection on IRC and talk to mormanman or whoever else is pitching in for the include..
BenLand100
2013-07-23 01:55:23
Updated to v8.2 as on github head. Contains all bugfixes to v8.1 and v8.1rev2, is the current stable SMART version, and should be included in the Simba plugin updater once SRL is made compatible by the devs. (That means everyone bug Wizzup about it.)
Wizzup?
2013-07-23 05:44:37
From: BenLand100
(That means everyone bug Wizzup about it.)
Since I assume people will mostly use this for the new RS03, I might as well push out Simba
1000 . It'll stabilise and become feature complete as we use it… ;-)
serajin
2013-07-24 17:37:03
Hey guys,
I made a new thread about this, but OfficerBrady told me to post here.
When I try to launch SMART after the 8.2 update I get this error
The smart window pops up and says:
<code>
Exception in threat "main" java.lang etc etc : smart/Main:
Unsupported major.minor version 51.0
at java.lang etc etc
Could not find the main class: smart.java Program will quit.
</code>
The error is longer, but hard to read, as it pops up and instantly disappears.
I have java 6 and 7, 64 bit installed. java 7's BIN path is in my variables. I also have the Java 7 JDK installed. 8.0 works perfectly fine.
Any ideas?
BenLand100
2013-07-25 02:36:19
From: serajin
Hey guys,
I made a new thread about this, but OfficerBrady told me to post here.
When I try to launch SMART after the 8.2 update I get this error
The smart window pops up and says:
<code>
Exception in threat "main" java.lang etc etc : smart/Main:
Unsupported major.minor version 51.0
at java.lang etc etc
Could not find the main class: smart.java Program will quit.
</code>
The error is longer, but hard to read, as it pops up and instantly disappears.
I have java 6 and 7, 64 bit installed. java 7's BIN path is in my variables. I also have the Java 7 JDK installed. 8.0 works perfectly fine.
Any ideas?
Java 6 must be the one actually on your path, or earlier on it. Run `java.exe -version` on command prompt and start a new thread with the output. Chances are it's just not running java 7
armthehomeless
2013-07-25 07:52:18
problem solved-don't be stupid
BenLand100
2013-07-25 09:41:54
From: armthehomeless
I'm getting
[Error] C:\Simba\Includes\SRL/SRL/misc/SmartParams.Simba(282:145): Type mismatch at line 281
Compiling failed.
Did a fresh install and still running into it. Smart8 is defined. Anyone have a fix?
Already asked,
and answered, a few times on this thread and in
RED TEXT on the first post:
Extra argument to SmartSpawnClient (meaning you need to change that call in SRL to work with new SMART until devs get SRL updated) to accept a list of plugins for SMART to load
I'm certain you can figure it out if you really, really, try.
armthehomeless
2013-07-25 10:19:59
Yeah you're right. I completely derped earlier when I was trying to get it to work, I couldn't comprehend that line in the original post. Needed to get my caffeine fix I guess :p
kriss1993
2013-07-26 01:28:57
im having weird bug it loaded up smart for me (oldschool) and it never started the script
then again it worked on my 1st try but as I tried to start 2nd simba and 2nd smart it just loaded up smart and never started the script any ideas?
Hoodz
2013-07-26 12:57:55
Any news about reflection for srl-osr?
From: hoodz
Any news about reflection for srl-osr?
What news are you looking for?
Hoodz
2013-07-26 13:11:37
If it works already/api is ready. @nkn
From: hoodz
If it works already/api is ready. @nkn
Reflection works
You have to get the reflection fields yourself, there is no autoupdater for it yet.
Hoodz
2013-07-26 13:43:16
From: NKN
Reflection works
You have to get the reflection fields yourself, there is no autoupdater for it yet.
I have no idea how to do that..
Hoodz
2013-07-26 13:51:23
Flight
2013-07-26 21:15:39
From: NKN
Enjoy
http://javahacking.org/forum/index.php?/topic/432-16/
Hm… I tried to register but I always get the challenge question wrong even though I'm quite sure it's correct. Apparently I'm a spam bot.
From: Flight
Hm… I tried to register but I always get the challenge question wrong even though I'm quite sure it's correct. Apparently I'm a spam bot.
Maybe your IP is flagged for some reason?
From: Flight
Hm… I tried to register but I always get the challenge question wrong even though I'm quite sure it's correct. Apparently I'm a spam bot.
Yea I had that problem too, but be careful it also changes the question like it interchanges between "what is the max OR min value of a 32 bit signed integer" so.. yea
kriss1993
2013-07-27 04:34:34
Oh well im having really weird bug with this1 sometimes it just loads up smart but the scripts never work no matter either you are logged in or not, usually when smart start even if its just a skeleton 1st thing it does is disables sound but seems like it gets stuck at rsready; loop well so fine I logged on myself but yet it pairs with correct smart but the script never starts not sure whats broken but Ill figure it out and send the report unless some1 else already have figured it out
samerdl
2013-07-27 15:20:33
Took me almost two hours to figure out how to get it to load Oldschool Rs, but it did.
How does reflection work? how can we use it: who, what, where, when, how, to whom?.. Much info is needed here!.
edit: also why weren't tabs added into smart 8.2? any plans to add that in the future?
Overall great, thanks a lot! :>
From: samerdl
Took me almost two hours to figure out how to get it to load Oldschool Rs, but it did.
How does reflection work? how can we use it: who, what, where, when, how, to whom?.. Much info is needed here!.
Overall great, thanks a lot! :>
People are getting hooks, but test run this it will get your skill level:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
begin
SetupSRL;
ClearDebug;
writeln(R_GetSkillLevel(1));
end.
samerdl
2013-07-27 15:34:36
From: Officer Barbrady
People are getting hooks, but test run this it will get your skill level:
{$DEFINE SMART}
{$I SRL/SRL.Simba}
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
begin
SetupSRL;
ClearDebug;
writeln(R_GetSkillLevel(1));
end.
Tried that gave me nothing so i changed it to smart8 and to srl osr.
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
begin
SetupSRL;
ClearDebug;
writeln(R_GetSkillLevel(1));
end.
Which worked!!!!!!!
91
Successfully executed.
Ok now please go ahead everyone, all the pro retired scripters flood the forums with guides that teach reflections so it will encouraged a growing of a reflection team for srl osr :) please do!
From: samerdl
Tried that gave me nothing so i changed it to smart8 and to srl osr.
{$DEFINE SMART8}
{$I SRL-OSR/SRL.Simba}
function R_GetSkillLevel(SkillConst: Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
end;
begin
SetupSRL;
ClearDebug;
writeln(R_GetSkillLevel(1));
end.
Which worked!!!!!!!
Ok now please go ahead everyone, all the pro retired scripters flood the forums with guides that teach reflections so it will encouraged a growing of a reflection team for srl osr :) please do!
:duh::duh: lol forgot to include OSR
samerdl
2013-07-27 15:39:52
From: Officer Barbrady
:duh::duh: lol forgot to include OSR
cant wait to waste many hours of my life trying to figure out reflection :thumbsup:
From: samerdl
cant wait to waste many hours of my life trying to figure out reflection :thumbsup:
Soon, you won't have to write client.ht ;)
Flight
2013-07-27 21:45:35
NKN this is a question aimed towards you, and if this is off-topic from the thread, Ben, just let me know and I'll delete it and PM NKN instead. If you and the others (Brandon, Mormonman, ect…) are planning to write an auto-updater for grabbing hooks, to be used in the OSR reflection library, won't this effect your efforts on your own bot, Pulsebot? If we had the fully working reflection include would you not lose interest in maintaining yours?
I know you and JJ have both been working hard on your own bot and I'd hate to see your progress go to waste, so to speak. But would you still rather work with a pure java & injection bot over Simba (which I'm sure you're familiar with Pascal & Lape at this point) with reflection?
From: Flight
NKN this is a question aimed towards you, and if this is off-topic from the thread, Ben, just let me know and I'll delete it and PM NKN instead. If you and the others (Brandon, Mormonman, ect…) are planning to write an auto-updater for grabbing hooks, to be used in the OSR reflection library, won't this effect your efforts on your own bot, Pulsebot? If we had the fully working reflection include would you not lose interest in maintaining yours?
I know you and JJ have both been working hard on your own bot and I'd hate to see your progress go to waste, so to speak. But would you still rather work with a pure java & injection bot over Simba (which I'm sure you're familiar with Pascal & Lape at this point) with reflection?
SRL-Reflection will be using the same hooks as PulseBot.
I'm writing the updater for both. I'll have it export to a file that simba and PulseBot reads, and then it just uses them from there. I don't have to write two separate updaters.
Flight
2013-07-27 22:16:39
From: NKN
SRL-Reflection will be using the same hooks as PulseBot.
I'm writing the updater for both. I'll have it export to a file that simba and PulseBot reads, and then it just uses them from there. I don't have to write two separate updaters.
I guess I was unclear in the question; what I meant was will you still be actively developing Pulsebot when Simba's OSR reflection is up and running? Or will you lose interest in maintaining your own bot and work with SRL-OSR instead?
From: Flight
I guess I was unclear in the question; what I meant was will you still be actively developing Pulsebot when Simba's OSR reflection is up and running? Or will you lose interest in maintaining your own bot and work with SRL-OSR instead?
I'll still have interest in Pulsebot. I find it enjoyable to figure out how Runescape actually works. Nothing feels better than seeing your code finally work.
SRL-Reflection was just a side thing that'd be easy to do with it, and since like, I <3 SRL, why not?
Hoodz
2013-07-28 10:57:46
From: NKN
SRL-Reflection will be using the same hooks as PulseBot.
I'm writing the updater for both. I'll have it export to a file that simba and PulseBot reads, and then it just uses them from there. I don't have to write two separate updaters.
great work, do you know when its done? and is there anything i can do to help you? (no java experience :s )
From: hoodz
great work, do you know when its done? and is there anything i can do to help you? (no java experience :s )
No idea when it's done, we have a lot of stuff left to hook.
Awkwardsaw
2013-07-28 19:07:53
From: NKN
No idea when it's done, we have a lot of stuff left to hook.
That being said, does the updater work as it is? Can we start creating semi reflections scripts using the not finished updater?
From: Awkwardsaw
That being said, does the updater work as it is? Can we start creating semi reflections scripts using the not finished updater?
I'm currently creating the modscript.
As of now, you can't use the updater to write scripts.
djborec
2013-07-29 14:21:11
Questions is if you can add "Window title renaming" to SMART in next release. I guess its not that hard just one more variable.
Hoodz
2013-07-29 16:07:03
From: djborec
Questions is if you can add "Window title renaming" to SMART in next release. I guess its not that hard just one more variable.
Are you from pb?
Kevin
2013-07-29 16:49:42
From: djborec
Questions is if you can add "Window title renaming" to SMART in next release. I guess its not that hard just one more variable.
I think we already have that. I think that was the following:
Disguise(str: String);
That also might have been changing the title on simba, but If I remembered the method name incorrectly, I'm still pretty sure it exists somewhere…
Could someone elaborate more on the SmartSpawnClient fixing part?
From: Awkwardsaw
That being said, does the updater work as it is? Can we start creating semi reflections scripts using the not finished updater?
The only usable thing for scripts is getting all NPC and player names. We haven't hooked stuff like the location, combat level, etc. yet. NKN is on holiday now and the updater is most likely on hold until he is back.
I haven't really looked properly at the old Reflection includes yet. If the API is well written then just passing the right class and field names could already make some stuff work.
BenLand100
2013-07-30 13:55:32
From: Awkwardsaw
That being said, does the updater work as it is? Can we start creating semi reflections scripts using the not finished updater?
People are going to drag their feet forever on getting an updater done. There is no reason you can't simply obtain paths from somewhere else and use them without the effort of writing an updater (though an updater maintained here would be good for stability and longevity). The hooks/paths are the same for EVERY bot it's just a matter of how you use them for your specific botting method. For reflection, you just need the paths and the API exported by SMART. I hear javahacking.org has them all for RS07 at least, though registering there is a pain. All you need in the "reflection include" is a file with variables for all the paths that you would update for any client revisions. 5 minutes of manually copying and pasting (or even a script to regex the hooks from some other source into a simba compatible format) per client update after someone else finds the paths is a no-shame method of getting things working until something better comes along.
tl;dr don't think there's a whole lot that needs to happen, just some string values need to be copied from somewhere to tell SMART what values to pull.
Awkwardsaw
2013-07-30 14:05:19
From: BenLand100
People are going to drag their feet forever on getting an updater done. There is no reason you can't simply obtain paths from somewhere else and use them without the effort of writing an updater (though an updater maintained here would be good for stability and longevity). The hooks/paths are the same for EVERY bot it's just a matter of how you use them for your specific botting method. For reflection, you just need the paths and the API exported by SMART. I hear javahacking.org has them all for RS07 at least, though registering there is a pain. All you need in the "reflection include" is a file with variables for all the paths that you would update for any client revisions. 5 minutes of manually copying and pasting (or even a script to regex the hooks from some other source into a simba compatible format) per client update after someone else finds the paths is a no-shame method of getting things working until something better comes along.
tl;dr don't think there's a whole lot that needs to happen, just some string values need to be copied from somewhere to tell SMART what values to pull.
I know we used to get them from rsbot way back when. Honestly, I have no problem if that's what we go back to doing. Maybe when I'm bored later today I can mess around with it
BenLand100
2013-07-30 14:10:01
From: Awkwardsaw
I know we used to get them from rsbot way back when. Honestly, I have no problem if that's what we go back to doing. Maybe when I'm bored later today I can mess around with it
Be interested, not bored:
http://javahacking.org/forum/index.php?/topic/432-16/A little effort understanding the Class structure for Player/NPC/Actor objects and some copypasta from that thread would give you flawless walking from scratch in about half an hour or so.
Brandon
2013-07-30 22:00:19
Dunno how to get array length or string length :S
Anyway, just passing by to say hi.
Oh well.. The following works so far. Examples on how to use Smart Reflection.. I think some may be a bit off or wrong but I tested them and they seem to work. R_GetDestination might be wrong though.. Stole that from someone some where. Not sure. Might be better to just Cache the "Me" ref.
{$include_once Ref/Misc/OldSchoolSmart.Simba}
function SmartGetFieldString(Parent: Integer; Path: String): String; //Function from old ref include. No clue who wrote it.
var
JStr: Integer;
begin
if(Parent < 0)then
Exit;
JStr := SmartGetFieldObject(Parent, Path);
SetLength(Result, 512); //dahell? Guessing 512 as max string length is probably a bad idea.. Need a real way for strlen.
SetLength(Result, SmartStringFromString(JStr, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
SmartFreeObject(JStr);
end;
function R_IsMenuOpen: Boolean;
begin
Result := SmartGetFieldBoolean(0, 'client.hw');
end;
function R_GetName: String;
var
Player: Integer;
Begin
Player := SmartGetFieldObject(0, 'p.ho');
Result := GetFieldString(Player, 'y');
SmartFreeObject(Player);
End;
function R_GetAnimation: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'ay') * -1297342091;
SmartFreeObject(Me);
End;
function R_IsAnimating: Boolean;
Begin
Result := R_GetAnimation > -1;
End;
function R_GetSkillLevel(SkillConst: Integer): Integer;
Begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
End;
function R_GetSkillExp(SkillConst: Integer): Integer;
Begin
Result := SmartGetFieldArrayInt(0, 'client.hu', SkillConst);
End;
function R_GetCameraX: Integer;
Begin
Result := SmartGetFieldInt(0, 'ca.fh') * 1600266873;
End;
function R_GetCameraY: Integer;
Begin
Result := SmartGetFieldInt(0, 'l.ft') * 1750131833;
End;
function R_GetCameraZ: Integer;
Begin
Result := SmartGetFieldInt(0, 'fq.fb') * -1357036389;
End;
function R_GetCameraYaw: Integer;
Begin
Result := SmartGetFieldInt(0, 'dq.fw') * -1896216087;
End;
function R_GetCameraPitch: Integer;
Begin
Result := SmartGetFieldInt(0, 'da.fx') * 39432791;
End;
function R_GetCompassAngle: Integer;
Begin
Result := round(R_GetCameraYaw / 5.67777); //Seems to work just fine for me :l
End;
{function R_GetPlayers: TPlayerArray; //No way to get array length? :S
var
Players: Integer;
Begin
Players := SmartGetFieldObject(0, 'client.bs');
SmartFreeObject(Players);
End;}
function R_GetDirection: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'bf') * 1172788427;
SmartFreeObject(Me);
End;
function R_GetDirectionString: String;
var
Dir: Integer;
Begin
Result := 'NIL';
Dir := R_GetDirection;
case Dir of
0: Result := 'S';
512: Result := 'W';
1024: Result := 'N';
1536: Result := 'E';
end;
End;
function R_GetTile: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(Me, 'z') * -344898115) div 128;
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(Me, 'v') * -331795885) div 128;
SmartFreeObject(Me);
End;
//Stolen hooks & Multipliers:
function R_Username: String;
begin
Result := GetFieldString(0, 'v.ac'); //seems to get my login username. Not player-name.
end;
function R_GetCombatLevel: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'n') * -74898749; //Seems to be accurate. Prints lvl 3.
SmartFreeObject(Me);
End;
Function R_GetDestination: TPoint; //Seems wrong. Does not match with R_GetTile when on the same spot.
Begin
//client.ma and client.mq with multiplier seems to be right. BaseX, BaseY may be wrong.
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(0, 'client.ma') * 1059776309);
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(0, 'client.mq') * -1519856356);
End;
var
T: TSmart;
begin
ClearDebug;
T.Create(765, 503);
while(true) do
begin
writeln(R_GetMyHeight);
Sleep(100);
end;
TerminateScript();
end.
Someone share the ASM pattern for NPC array or GetNPC with whoever is going to finish up.
Flight
2013-07-30 22:23:14
Very nice Brandon, that's looking good. If you ask me that right there is all we need, assuming we can use a bit of math and calculate other on-screen tiles as well as convert them to MM tiles.
Writing a walking include now while I'm at the hotel.
We'll see how it goes.
Awkwardsaw
2013-07-30 22:46:24
From: Brandon
Dunno how to get array length or string length :S
Anyway, just passing by to say hi.
Oh well.. The following works so far. Examples on how to use Smart Reflection.. I think some may be a bit off or wrong but I tested them and they seem to work. R_GetDestination might be wrong though.. Stole that from someone some where. Not sure. Might be better to just Cache the "Me" ref.
{$include_once Ref/Misc/OldSchoolSmart.Simba}
function SmartGetFieldString(Parent: Integer; Path: String): String; //Function from old ref include. No clue who wrote it.
var
JStr: Integer;
begin
if(Parent < 0)then
Exit;
JStr := SmartGetFieldObject(Parent, Path);
SetLength(Result, 512); //dahell? Guessing 512 as max string length is probably a bad idea.. Need a real way for strlen.
SetLength(Result, SmartStringFromString(JStr, Result));
Result := Replace(Result, 'Â', '', [rfReplaceAll]);
Result := Replace(Result, #160, #32, [rfReplaceAll]);
SmartFreeObject(JStr);
end;
function R_IsMenuOpen: Boolean;
begin
Result := SmartGetFieldBoolean(0, 'client.hw');
end;
function R_GetName: String;
var
Player: Integer;
Begin
Player := SmartGetFieldObject(0, 'p.ho');
Result := GetFieldString(Player, 'y');
SmartFreeObject(Player);
End;
function R_GetAnimation: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'ay') * -1297342091;
SmartFreeObject(Me);
End;
function R_IsAnimating: Boolean;
Begin
Result := R_GetAnimation > -1;
End;
function R_GetSkillLevel(SkillConst: Integer): Integer;
Begin
Result := SmartGetFieldArrayInt(0, 'client.ht', SkillConst);
End;
function R_GetSkillExp(SkillConst: Integer): Integer;
Begin
Result := SmartGetFieldArrayInt(0, 'client.hu', SkillConst);
End;
function R_GetCameraX: Integer;
Begin
Result := SmartGetFieldInt(0, 'ca.fh') * 1600266873;
End;
function R_GetCameraY: Integer;
Begin
Result := SmartGetFieldInt(0, 'l.ft') * 1750131833;
End;
function R_GetCameraZ: Integer;
Begin
Result := SmartGetFieldInt(0, 'fq.fb') * -1357036389;
End;
function R_GetCameraYaw: Integer;
Begin
Result := SmartGetFieldInt(0, 'dq.fw') * -1896216087;
End;
function R_GetCameraPitch: Integer;
Begin
Result := SmartGetFieldInt(0, 'da.fx') * 39432791;
End;
function R_GetCompassAngle: Integer;
Begin
Result := round(R_GetCameraYaw / 5.67777); //Seems to work just fine for me :l
End;
{function R_GetPlayers: TPlayerArray; //No way to get array length? :S
var
Players: Integer;
Begin
Players := SmartGetFieldObject(0, 'client.bs');
SmartFreeObject(Players);
End;}
function R_GetDirection: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'bf') * 1172788427;
SmartFreeObject(Me);
End;
function R_GetDirectionString: String;
var
Dir: Integer;
Begin
Result := 'NIL';
Dir := R_GetDirection;
case Dir of
0: Result := 'S';
512: Result := 'W';
1024: Result := 'N';
1536: Result := 'E';
end;
End;
function R_GetTile: TPoint; //not sure if I need BaseX, BaseY addition as in the old ref-include. Seems to work though.
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := SmartGetFieldInt(Me, 'z') * -344898115;
Result.Y := SmartGetFieldInt(Me, 'v') * -331795885;
SmartFreeObject(Me);
End;
//Stolen hooks & Multipliers:
function R_Username: String;
begin
Result := GetFieldString(0, 'v.ac'); //seems to get my login username. Not player-name.
end;
function R_GetCombatLevel: Integer;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result := SmartGetFieldInt(Me, 'n') * -74898749; //Seems to be accurate. Prints lvl 3.
SmartFreeObject(Me);
End;
Function R_GetDestination: TPoint; //Seems wrong. Does not match with R_GetTile when on the same spot.
Begin
//client.ma and client.mq with multiplier seems to be right. BaseX, BaseY may be wrong.
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(0, 'client.ma') * 1059776309);
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(0, 'client.mq') * -1519856356);
End;
var
T: TSmart;
begin
ClearDebug;
T.Create(765, 503);
while(true) do
begin
writeln(R_GetMyHeight);
Sleep(100);
end;
TerminateScript();
end.
Someone share the ASM pattern for NPC array or GetNPC with whoever is going to finish up.
Awesome! I'm working on walking atm using these, but getting/ finding the tiles doesn't seem to be accurate.
function R_GetCameraYaw: Integer;
Begin
Result := SmartGetFieldInt(0, 'dq.fw') * -1896216087;
End;
function R_GetCompassRadian: extended; //your getdegrees func, just converted to rads
Begin
Result := radians(R_GetCameraYaw / 5.67777);
End;
function R_GetTile: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := SmartGetFieldInt(Me, 'z') * -344898115;
Result.Y := SmartGetFieldInt(Me, 'v') * -331795885;
SmartFreeObject(Me);
End;
function TileToMM(tile: TPoint): TPoint; //taken from srl-reflection include
var
angle, x, y: extended;
temp: TPoint;
begin
angle:= -R_GetCompassRadian;
temp := R_GetTile;
x:= (tile.x - temp.x) * 4 - 2;
y:= (temp.y - tile.y) * 4 - 2;
result.x:= round(x*cos(angle) + y*sin(angle)) + 628;
result.y:= round(y*cos(angle) - x*sin(angle)) + 87;
end;
function TileOnMM(Tile: TPoint): boolean;
var
P: TPoint;
begin
P := TileToMM(Tile);
Result := rs_OnMinimap(point(P.x, P.y));
end;
function AreWeAt(where : integer; var tp : TPoint) : boolean;
var
MyTP, LocTP : TPoint;
begin
case where of
0 : LocTP := point(6080, 6464);
1 : LocTP := point(6848, 5824);
end;
MyTP := R_GetTile;
result := TileOnMM(LocTP); //bank tile : (6848, 6848)
if result then
begin //mine tile : (6080, 6464)
tp := TileToMM(LocTP);
writeln('tile on mm');
end;
end;
Your gettile seems to get random tiles. As soon as I move off of it, it changes and the script can't find the tile
Brandon
2013-07-30 23:07:34
From: Awkwardsaw
Your get tile seems to get random tiles. As soon as I move off of it, it changes and the script can't find the tile
You can't just take code from the old include any expect it to work. Might need BaseX, BaseY for it as well.
Awkwardsaw
2013-07-30 23:12:10
From: Brandon
You can't just take code from the old include any expect it to work. Might need BaseX, BaseY for it as well.
Things seemed to fit together, So I gave it a shot. It's very true that TileToMM might also not work, but gettile() its self is also sporadic
Brandon
2013-07-30 23:18:02
From: Awkwardsaw
Things seemed to fit together, So I gave it a shot. It's very true that TileToMM might also not work, but gettile() its self is also sporadic
Try:
function R_GetTileGlobal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(Me, 'z') * -344898115) div 128;
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(Me, 'v') * -331795885) div 128;
SmartFreeObject(Me);
End;
function R_GetTileLocal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := ((SmartGetFieldInt(Me, 'z') * -344898115) - (SmartGetFieldInt(0, 'd.cy') * 670470189)) div 128;
Result.Y := ((SmartGetFieldInt(Me, 'v') * -331795885) - (SmartGetFieldInt(0, 'r.cl') * -1567957809)) div 128;
SmartFreeObject(Me);
End;
function R_TileToMM(tile: TPoint): TPoint;
var
angle, x, y: extended;
temp: TPoint;
begin
angle:= -Radians(R_GetCompassAngle);
temp := R_GetTileGlobal;
x:= (tile.x - temp.x) * 4 - 2;
y:= (temp.y - tile.y) * 4 - 2;
result.x:= round(x*cos(angle) + y*sin(angle)) + 645;
result.y:= round(y*cos(angle) - x*sin(angle)) + 85;
end;
Works and more accurate too. Walk one tile left, the X decreases by 1. Walk one tile north, Y increases by 1. Vice-Versa.
BenLand100
2013-07-30 23:31:51
Hmm. I could add a thing to get array/string length, but for most things it should be unnecessary..
Flight
2013-07-30 23:36:16
From: BenLand100
Hmm. I could add a thing to get array/string length, but for most things it should be unnecessary..
I'm a noob in this field but could that not already be determined, via Simba, after we've received a result from SMART?
BenLand100
2013-07-31 09:36:01
From: Flight
I'm a noob in this field but could that not already be determined, via Simba, after we've received a result from SMART?
For string length, sure. You could allocate a "big enough" string and have SMART fill it, then SMART does return the number of characters it wrote. For arrays, though, you can't *really* know where the end is, unless you keep trying to index it and get an error value (probably -1 for ints).
Awkwardsaw
2013-07-31 19:14:52
So, If no one has started writing the include, I'd be happy to set one up on git. me and NKN are kind of starting on it.
edit:
https://github.com/Awkwardsaw/OSRR
function R_inArea(TileX1, TileY1, TileX2, TileY2:Integer):Boolean;
begin
result := PointInBox(r_GetTileGlobal, (IntToBox(TileX1, TileY1, TileX2, TileY2)));
end;
Lol if anyone wants it
or
{
written by Felipe Monteiro de Carvalho
slightly edited by Officer Barbrady
}
function R_inArea(Area: array of TPoint): Boolean;
var
xnew, ynew, xold, yold, x1, y1, x2, y2: Cardinal;
i, numpoints, inside, X, Y: Integer;
begin
numpoints := Length(Area);
X := R_GetTileGlobal.x
Y := R_GetTileGlobal.y
if (numpoints < 3) then Exit;
xold := Area[numpoints-1].X;
yold := Area[numpoints-1].Y;
for i := 0 to (numpoints - 1) do
begin
xnew := Area[i].X;
ynew := Area[i].Y;
if (xnew > xold) then
begin
x1:=xold;
x2:=xnew;
y1:=yold;
y2:=ynew;
end else
begin
x1:=xnew;
x2:=xold;
y1:=ynew;
y2:=yold;
end;
if (((xnew < X) = (X <= xold)) and ((Y-y1)*(x2-x1) < (y2-y1)*(X-x1))) then
inside := not inside;
xold:=xnew;
yold:=ynew;
end;
Result := inside <> 0;
end;
pyroryan
2013-07-31 21:36:28
From: Brandon
{function R_GetPlayers: TPlayerArray; //No way to get array length? :S
var
Players: Integer;
Begin
Players := SmartGetFieldObject(0, 'client.bs');
SmartFreeObject(Players);
End;}
//Stolen hooks & Multipliers:
function R_Username: String;
begin
Result := GetFieldString(0, 'v.ac'); //seems to get my login username. Not player-name.
end;
Function R_GetDestination: TPoint; //Seems wrong. Does not match with R_GetTile when on the same spot.
Begin
//client.ma and client.mq with multiplier seems to be right. BaseX, BaseY may be wrong.
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(0, 'client.ma') * 1059776309);
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(0, 'client.mq') * -1519856356);
End;
Someone share the ASM pattern for NPC array or GetNPC with whoever is going to finish up.
The length of the NPC/Player arrays that contain relevant information is stored in a field. You'll see a loop that loops x times (where x is defined by the value of the count field). The lack of a method to get array length goes back years, that's why I had to keep NPCCount and PlayerCount around.
Regarding "v.ac", that's login username as you believed. "v.al" is login password.
In R_GetDestination, based on other logs: (SmartGetFieldInt(0, 'client.mq') * 3915003207);
From: pyroryan
The length of the NPC/Player arrays that contain relevant information is stored in a field. You'll see a loop that loops x times (where x is defined by the value of the count field). The lack of a method to get array length goes back years, that's why I had to keep NPCCount and PlayerCount around.
Regarding "v.ac", that's login username as you believed. "v.al" is login password.
In R_GetDestination, based on other logs: (SmartGetFieldInt(0, 'client.mq') * 3915003207);
You gonna come back and help with reflection? ;)
pyroryan
2013-07-31 21:50:34
From: NKN
You gonna come back and help with reflection? ;)
I'm too busy with other things in life. However, I do answer questions on an as needed (random) basis.
{$DEFINE SMART}
{$i SRL-OSR/SRL.simba}
function R_GetTileGlobal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(Me, 'z') * -344898115) div 128;
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(Me, 'v') * -331795885) div 128;
SmartFreeObject(Me);
End;
{
written by Felipe Monteiro de Carvalho
slightly edited by Officer Barbrady
}
function R_inPolygon(Area:TPointArray): Boolean;
var
xnew, ynew, xold, yold, x1, y1, x2, y2: Cardinal;
i, numpoints, inside, X, Y: Integer;
begin
numpoints := Length(Area);
X := R_GetTileGlobal.x
Y := R_GetTileGlobal.y
if (numpoints < 3) then Exit;
xold := Area[numpoints-1].X;
yold := Area[numpoints-1].Y;
for i := 0 to (numpoints - 1) do
begin
xnew := Area[i].X;
ynew := Area[i].Y;
if (xnew > xold) then
begin
x1:=xold;
x2:=xnew;
y1:=yold;
y2:=ynew;
end else
begin
x1:=xnew;
x2:=xold;
y1:=ynew;
y2:=yold;
end;
if (((xnew < X) = (X <= xold)) and ((Y-y1)*(x2-x1) < (y2-y1)*(X-x1))) then
inside := not inside;
xold:=xnew;
yold:=ynew;
end;
Result := inside <> 0;
end;
var
BankArea:TPointArray;
begin
ClearDebug;
setupsrl;
BankArea := [Point(3092, 3240), Point(3091, 3247), Point(3095, 3241), Point(3095, 3246)]
Writeln(R_InArea(BankArea));
end.
Woo works very nice. I don' think we can add it to the include though:
http://wiki.freepascal.org/Geometry_in_Pascal
Brandon
2013-07-31 23:20:31
From: pyroryan
The length of the NPC/Player arrays that contain relevant information is stored in a field. You'll see a loop that loops x times (where x is defined by the value of the count field). The lack of a method to get array length goes back years, that's why I had to keep NPCCount and PlayerCount around.
Regarding "v.ac", that's login username as you believed. "v.al" is login password.
In R_GetDestination, based on other logs: (SmartGetFieldInt(0, 'client.mq') * 3915003207);
:o Long time no see!
K I'll look for the length and stuff later (might be quite some time from now). Either that or I'll edit smart lol. That 3915003207 multiplier works. Dunno where you got it though, but it works so that's good enough for anyone I guess.
Function R_GetDestination: TPoint;
Begin
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(0, 'client.ma') * 1059776309);
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) - (SmartGetFieldInt(0, 'client.mq') * 3915003207);
End;
@BenLand100; How do I do the following in Simba:
Field Arr = loader.loadClass("client").getDeclaredField("ga"); //Get player array.
Arr.setAccessible(true);
Object PlayerArray[] = (Object[])Arr.get(null);
for (int I = 0; I < PlayerArray.length; ++I) {
if (PlayerArray[I] != null) {
Field f = loader.loadClass("d").getDeclaredField("y"); //Get Player Composite.
f.setAccessible(true);
System.out.println((String)f.get(PlayerArray[I])); //Get Player Name.
}
}
I do the above in my loader/tester.. It prints the players names..
Then I tried to do it using code from Smart like so:
Object PlayerArray[] = (Object[])findObjectFromPath(null, "client.ga"); //Get player array. Works fine.
for (int I = 0; I < PlayerArray.length; ++I) {
if (PlayerArray[I] != null) {
Field f = loader.loadClass("d").getDeclaredField("y"); //Get player composite. Works fine.
f.setAccessible(true);
System.out.println((String)f.get(PlayerArray[I])); //Get that player's name. Works fine.
}
}
and that works..
However, doing it with:
Object PlayerArray[] = (Object[])findObjectFromPath(null, "client.ga"); //Works fine.
for (int I = 0; I < PlayerArray.length; ++I) {
if (PlayerArray[I] != null) {
String Name = (String)findObjectFromPath(PlayerArray[I], "d.y"); //Fail.
System.out.println(Name);
}
}
gives me errors. It throws class cast exception that I cannot cast an int to a string. So I tried the following in Simba:
function R_GetPlayerName: String;
var
Player: Integer;
Begin
Player := SmartGetFieldArrayObject(0, 'client.ga', 0); //Get player at index 0 in the player array.
if (SmartIsNull(Player)) then Exit; //It's always null :S
writeln(SmartGetFieldString(Players, 'd.y')); //Get name from player 0?
SmartFreeObject(Players);
End;
I even tried looping through it up to 500. No cigar. Is something wrong with FindObjectFromPath or am I doing something wrong?
BenLand100
2013-08-01 09:46:50
Field f = loader.loadClass("d").getDeclaredField("y");
Accessor for NONSTATIC field 'y' from class 'd' - i.e. the 'd' is only necessary for the static scope.
f.get(PlayerArray[I]));
Translates to
SmartGetFieldObject(PlayerArray[i],'y')
In general: if your origin object is not null, you do not need to specify the class. In java you only needed the class because you had to get the nonstatic field accessor to then apply to the object. Smart reflection code will tend to look JUST like the normal accessor for a variable.
Static case:
Class.field
SmartGetFieldObject(0,'Class.field')
Nonstatic case:
object.field
SmartGetFieldObject(object,'field')
Edit: As for why the player is always null… might be a bug. I'll have to look later. At any rate, the player being null SHOULD NOT cause a crash if it is used, just a meaningless result. (Can you confirm that using a nonstatic origin works for something?)
xxpoopyxx2
2013-08-01 10:05:52
plllllleeease help please
added Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
Getting error
C:\Simba\Includes\SRL-OSR/SRL/misc/SmartParams.Simba(241:81): Unknown identifier 'Params' at line 240
and with reflection are we talking about the old bots that used java all that crap?
could this mean smarter and easier more reliable ways to do things like walking and banking and stores and npcs and blah blah and more :DDDD???
or am i completely wrong
Brandon
2013-08-01 13:09:30
From: BenLand100
Nonstatic case:
object.field
SmartGetFieldObject(object,'field')
Edit: As for why the player is always null… might be a bug. I'll have to look later. At any rate, the player being null SHOULD NOT cause a crash if it is used, just a meaningless result. (Can you confirm that using a nonstatic origin works for something?)
Scratch that. It works. I figured it out. The object array does indeed work. Everything works so far. Not sure what the hell happened this morning but right after I read through the smart source to see if there are mistakes, I press play and the code works.
Must have been messing something up.
pyroryan
2013-08-01 14:50:13
From: Brandon
That 3915003207 multiplier works. Dunno where you got it though, but it works so that's good enough for anyone I guess.
JBE on the jar after minor deobbing. You originally had -1519856356 as the multiplier. It's an even number. Without going into technical details, that's a dead giveaway that it's wrong because even numbers cannot be inverted.
BenLand100
2013-08-01 15:38:57
From: Brandon
Scratch that. It works. I figured it out. The object array does indeed work. Everything works so far. Not sure what the hell happened this morning but right after I read through the smart source to see if there are mistakes, I press play and the code works.
Must have been messing something up.
Did you make sure Simba was paired with the proper SMART? Note: simply setting the EIOS target is not enough. SmartSpawnClient will pair automatically, but then every time you restart the script, you'll have to SmartPairClient with the proper PID in order for the SMART plugin to send the reflection commands to the right place. Unfortunately this again means that reflection scripts will be one per Simba process since the Simba process can only pair with one SMART at a time. The ways around this would require significant changes (an extra arugment to all reflection methods, or really to all client-specific methods if I actually do it), but could be implemented if deemed necessary.
Hoodz
2013-08-01 17:05:59
From: pyroryan
I'm too busy with other things in life. However, I do answer questions on an as needed (random) basis.
stay!
mormonman
2013-08-02 11:56:58
From: BenLand100
Did you make sure Simba was paired with the proper SMART? Note: simply setting the EIOS target is not enough. SmartSpawnClient will pair automatically, but then every time you restart the script, you'll have to SmartPairClient with the proper PID in order for the SMART plugin to send the reflection commands to the right place. Unfortunately this again means that reflection scripts will be one per Simba process since the Simba process can only pair with one SMART at a time. The ways around this would require significant changes (an extra arugment to all reflection methods, or really to all client-specific methods if I actually do it), but could be implemented if deemed necessary.
Just do it now, before we have to edit a whole include.
Brandon
2013-08-02 12:30:14
I think the problem with the pairing is that simba's script thread dies and smart uses that ID to figure out who the controller is. Every time it pairs, it'll pair to one that's not already paired rather than the one it was originally paired to. (The one that it spawned)
So even if Ben does add an extra argument, you'd still have to tell it which one to pair to.
One Simba process can already have multiple smarts.. The problem is knowing which tab to pair with which smart as described above.
BenLand100
2013-08-02 13:48:23
From: Brandon
I think the problem with the pairing is that simba's script thread dies and smart uses that ID to figure out who the controller is. Every time it pairs, it'll pair to one that's not already paired rather than the one it was originally paired to. (The one that it spawned)
So even if Ben does add an extra argument, you'd still have to tell it which one to pair to.
One Simba process can already have multiple smarts.. The problem is knowing which tab to pair with which smart as described above.
You'll have to pair each time, regardless. The problem with pairing is that the Simba process has only one instance of the SmartRemote plugin which has only one local paired SMART (i.e. not on a per-script basis). So, all scripts in that process are paired to the same SMART at the same time, and then that autounpairs when the script dies to prevent leaking memory.
E: it's not an easy thing to change, as having the script manage its own pairing will likely lead to memory leaks, or SMART clients getting hung up on a dead script.
E: Also function SmartGetFieldArraySize(objref: integer; path: string; dim: integer): integer;
Brandon
2013-08-02 19:10:15
So, all scripts in that process are paired to the same SMART at the same time
:S?? You lost me there. I know it has one local instance within the plugin but Simba can have one script per tab and each one has their own Smart. For OpenGL for example, I can run two Smarts with one Simba and each script controls one Smart. Works just fine. Shouldn't be different for reflection then right?
From: BenLand100
E: Also function SmartGetFieldArraySize(objref: integer; path: string; dim: integer): integer;
Doesn't work for 1D arrays. Well I'm not so sure it works right at least. For NPC Array, this prints 32000+ and for Players it prints 2048 always.
SmartGetFieldArraySize(0, 'client.bs', 0); //Get size of index 0? :S
My updater returns client.bn as the NPCIndex array but Smart returns that as 0 all the time.. Probably a broken hook. Dunno if I got some hooks wrong. Stole a couple from n3ss3s and swipe until I find those ones myself. But I got this so far:
type TPlayer = record
ID: Integer;
Name: String;
Level: Integer;
Tile: TPoint;
Animation: Integer;
WalkQueueX: Integer;
WalkQueueY: Integer;
Orientation: Integer;
OrientationStr: String;
Equipment: Array of Integer;
end;
type TNPC = record
ID: Integer;
Name: String;
Index: Integer;
Level: Integer;
Tile: TPoint;
Animation: Integer;
WalkQueueX: Integer;
WalkQueueY: Integer;
Orientation: Integer;
OrientationStr: String;
Actions: Array of String;
end;
function R_GetDirectionString(Orientation: Integer): String; //TODO: Fix this for angles inbetween the below.. NE, SE, NW, SW, etc..
var
Dir: Integer;
Begin
Result := 'NIL';
case Orientation of
0: Result := 'S';
512: Result := 'W';
1024: Result := 'N';
1536: Result := 'E';
end;
End;
function R_GetNPCActionArray(NPCDef: integer): TStringArray; //function written by drags from old ref include.
var
i, c: integer;
temp: String;
begin
SetLength(Result, 11);
c := 0;
for i := 0 to 10 do
begin
temp := SmartGetFieldArrayString(NPCDef, 'v', i); //TODO: Fix this hook in the updater. Still broken. Stolen from somewhere :S
if(temp <> '')then
begin
Result[c] := temp;
inc(c);
end;
end;
SetLength(Result, c);
end;
function R_GetNPCs: Array of TNPC; //Too slow. Need actual NPC size.
var
Name: String;
I, J, NPC, DEF, Size: Integer;
Begin
J := 0; //TODO: Fix my NPC-Index Array hook.
Size := SmartGetFieldArraySize(0, 'client.bs', 0); //Returns 32000+.. TODO: Find Actual array size or Get size of NPC Index Array.
SetLength(Result, 256);
For I := 0 To Size do
begin
NPC := SmartGetFieldArrayObject(0, 'client.bs', I);
//SmartGetFieldArrayInt(0, 'client.bn', I); //NPC Index array. Not sure why it's always 0. Updater prints this as index array.
//Would be faster to iterate using the indices if it worked..
if (NPC <> 0) then
begin
DEF := SmartGetFieldObject(NPC, 'y');
Name := SmartGetFieldString(DEF, 's');
If (Name <> 'null') then
begin
Result[J].Name := Name;
Result[J].ID := SmartGetFieldInt(DEF, 'n') * -1972562829; //From @N3ss3s's log.
Result[J].Level := SmartGetFieldInt(DEF, 'h') * 610526779;
Result[J].Index := SmartGetFieldInt(NPC, 'az') * -695887265; //Interacting Index. From Swipe's log.
Result[J].Animation := SmartGetFieldInt(NPC, 'ay') * -1297342091;
Result[J].Orientation := SmartGetFieldInt(NPC, 'bf') * 1172788427;
Result[J].OrientationStr := R_GetDirectionString(Result[J].Orientation);
Result[J].WalkQueueX := SmartGetFieldArrayInt(NPC, 'bs', 0); //From Swipe's log.
Result[J].WalkQueueY := SmartGetFieldArrayInt(NPC, 'ba', 0); //From Swipe's log.
Result[J].Tile.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(NPC, 'z') * -344898115) div 128;
Result[J].Tile.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) - (SmartGetFieldInt(NPC, 'v') * -331795885) div 128;
Result[J].Actions := R_GetNPCActionArray;
Inc(J);
end;
SmartFreeObject(DEF);
end;
SmartFreeObject(NPC);
end;
SetLength(Result, J);
End;
dzpliu
2013-08-03 11:32:58
From: ignotum
Wondering this too. Maybe it's related to why I can't load SMART. :duh:
check first page…post by ashaman
BenLand100
2013-08-03 11:33:54
From: Brandon
:S?? You lost me there. I know it has one local instance within the plugin but Simba can have one script per tab and each one has their own Smart. For OpenGL for example, I can run two Smarts with one Simba and each script controls one Smart. Works just fine. Shouldn't be different for reflection then right?
For Color and IO you give Simba the image pointer and EIOS target at the beginning of each script and then don't use any SMART exported functions. When the libsmartremote plugin pairs with a SMART, then all Smart* functions are tied to that SMART, but this is a PER PROCESS pairing since Simba only loads ONE copy of libsmartremote. Even though libsmartremote is paired with a SMART on a per process basis, the image handle remains valid until the paired thread terminates (only reasonable time to clean up memory) and the EIOS functions have an extra argument so that Simba can have a per-script EIOS target.
Basically not destroying the shared memory until the thread exits lets Simba target multiple SMARTs per process for color data, and the EIOS system with its extra target argument lets Simba target multiple SMARTs per process for user input (the EIOS system inside of Simba has a per-script variable that IS the target, and is what you set with SetEIOSTarget). No such system exists for reflection, besides the SmartPairClient method (which is shared among all scripts in the process), and hence only one SMART at a time per process may be used for reflection, and all other Smart*, methods.
From: Brandon
SmartGetFieldArraySize(0, 'client.bs', 0); //Get size of index 0? :S
Not index zero, the variable is called dimension for a reason. The equivalent java statement is
SmartGetFieldArraySize(0, 'client.bs', 0) == client.bs.length
SmartGetFieldArraySize(0, 'client.bs', 1) == client.bs[0].length
SmartGetFieldArraySize(0, 'client.bs', 2) == client.bs[0][0].length
dzpliu
2013-08-03 11:48:28
From: ignotum
Thanked you, fixed it. Had to install 32 bit Java as well for it to work.
Anyway, does SMART currently not work with RS3?
it works with rs3, but u gotta edit a few parts. it wont work well too…unless u are making a very simple script, or else alot of the functions are currently broken.
Flight
2013-08-03 12:11:13
From: Brandon
Try:
function R_GetTileGlobal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(Me, 'z') * -344898115) div 128;
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(Me, 'v') * -331795885) div 128;
SmartFreeObject(Me);
End;
function R_GetTileLocal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := ((SmartGetFieldInt(Me, 'z') * -344898115) - (SmartGetFieldInt(0, 'd.cy') * 670470189)) div 128;
Result.Y := ((SmartGetFieldInt(Me, 'v') * -331795885) - (SmartGetFieldInt(0, 'r.cl') * -1567957809)) div 128;
SmartFreeObject(Me);
End;
function R_TileToMM(tile: TPoint): TPoint;
var
angle, x, y: extended;
temp: TPoint;
begin
angle:= -Radians(R_GetCompassAngle);
temp := R_GetTileGlobal;
x:= (tile.x - temp.x) * 4 - 2;
y:= (temp.y - tile.y) * 4 - 2;
result.x:= round(x*cos(angle) + y*sin(angle)) + 645;
result.y:= round(y*cos(angle) - x*sin(angle)) + 85;
end;
Works and more accurate too. Walk one tile left, the X decreases by 1. Walk one tile north, Y increases by 1. Vice-Versa.
Works wonderfully. Since I only needed the Global Tile & TileToMM conversion I merged a couple of your previous functions to come up with these:
function R_GetTileGlobal: TPoint;
var
Me: Integer;
Begin
Me := SmartGetFieldObject(0, 'p.ho');
Result.X := (SmartGetFieldInt(0, 'd.cy') * 670470189) + (SmartGetFieldInt(Me, 'z') * -344898115) div 128;
Result.Y := (SmartGetFieldInt(0, 'r.cl') * -1567957809) + (SmartGetFieldInt(Me, 'v') * -331795885) div 128;
SmartFreeObject(Me);
End;
function R_TileToMM(tile: TPoint): TPoint;
var
yaw: Integer;
angle,x,y: extended;
temp: TPoint;
begin
yaw := SmartGetFieldInt(0, 'dq.fw') * -1896216087;
angle := -Radians(round(yaw / 5.67777));
temp := R_GetTileGlobal;
x := (tile.x - temp.x) * 4 - 2;
y := (temp.y - tile.y) * 4 - 2;
result.x := round(x*cos(angle) + y*sin(angle)) + 645;
result.y := round(y*cos(angle) - x*sin(angle)) + 85;
end;
Function walkPath(Path: TPointArray): boolean;
var
I,H,T,D,Fails,lP: integer;
P,MM,MMF: TPoint;
begin
ColorToleranceSpeed(1);
H := High(Path);
T := GetSystemTime + 10000 + Random(2000);
Fails := 0;
AL_GameTab(tab_Inv);
lP := 0;
while (not Result) and (GetSystemTime < T) and (Fails < 5) do
begin
if (not LoggedIn()) then
Exit;
P := R_GetTileGlobal;
for I := H downto 0 do
begin
if ((I - lP) > 3) then
Continue
else
lP := I;
MM := R_TileToMM(Path[I]);
if MM = MMF then
Inc(Fails);
D := Distance(MM.X, MM.Y, MMCX, MMCY);
if (D < 10) then
break
else
if (D < 70) then
begin
AL_MissMouse(MM, 0, 0);
AL_FastClick(mouse_left);
WaitFunc(@AL_playerWalking, 10, 500);
MMF := MM;
if (I = H) then
FFlag(5)
else
FFlag(25);
T := getSystemTime + 7000 + Random(1000);
Break;
end;
end;
Result := (I = H);
end;
FFlag(5);
end;
function BlindWalk(P: TPoint): Boolean;
var
Tries: Integer;
M: TPoint;
ctrlPoints: TPointArray;
begin
repeat
if (not LoggedIn()) then
Exit;
M := R_GetTileGlobal;
if (M.X = -1) then
Continue;
if (Length(ctrlPoints) = 0) then
ctrlPoints := TPABetweenPoints(M, P, 5 + Random(2), 2);
Inc(Tries);
if (Tries > 20) then
Exit;
Result := walkPath(ctrlPoints);
until(Result);
end;
It's really nice to have dependable walking. I can make so much with this alone…
[======================================]
[ Naturez 07 Dev ]
[ by Flight ]
[======================================]
[ Script Run Time : 3 Hr 24 Min 20 Sec ]
[ Runecrafting XP : 14,400 (4,228/Hr) ]
[ Runes Crafted : 1,600 (469/Hr) ]
[ Total Runs : 72 ]
[======================================]
[ Naturez 07 Dev ]
[======================================]
Edit:
Ah I'm sorry, I've forgotten this is still on the SMART thread. I apologize Ben, no hijacking intended.
BenLand100
2013-08-03 14:49:28
Those of you doing dev work for SMART/reflection may want to check out the changes I've made on git. It basically amounts to removing the per-process pairing mechanism, and gives you the paired client data (known as the target) directly from both the SmartSpawnClient and SmartPairClient methods. This target value must then be passed as the first argument to any target-specific methods (see: reflection) in order for the Simba plugin to know which SMART to talk to. This will allow a single Simba process (or even a single script!
tandem scripts, anyone?) to reflect/control multiple SMART targets. Currently SMARTv8.2 can only support reflection of ONE client per process as the pairing mechanism was local to the plugin (i.e. the plugin paired with a client, NOT the script); these changes make the script responsible to keeping track of its SMART client. The only downside is that on script termination you should use SmartFreeClient (a new method) to release the target. Summary of changes can be gleaned from here:
https://github.com/BenLand100/SMART/blob/master/src/SmartRemote.h#L302
Flight
2013-08-03 21:03:35
From: BenLand100
Those of you doing dev work for SMART/reflection may want to check out the changes I've made on git. It basically amounts to removing the per-process pairing mechanism, and gives you the paired client data (known as the target) directly from both the SmartSpawnClient and SmartPairClient methods. This target value must then be passed as the first argument to any target-specific methods (see: reflection) in order for the Simba plugin to know which SMART to talk to. This will allow a single Simba process (or even a single script! tandem scripts, anyone?) to reflect/control multiple SMART targets. Currently SMARTv8.2 can only support reflection of ONE client per process as the pairing mechanism was local to the plugin (i.e. the plugin paired with a client, NOT the script); these changes make the script responsible to keeping track of its SMART client. The only downside is that on script termination you should use SmartFreeClient (a new method) to release the target. Summary of changes can be gleaned from here: https://github.com/BenLand100/SMART/blob/master/src/SmartRemote.h#L302
Ha now that's cool. 2 SMARTs 1 Simba (old reference). Very handy if you've multiple in-game accounts you're wanting to run the same script with. But I can't imagine how that would work script-side. Perhaps I'm missing the obvious though.
BenLand100
2013-08-03 21:09:03
From: Flight
Ha now that's cool. 2 SMARTs 1 Simba (old reference). Very handy if you've multiple in-game accounts you're wanting to run the same script with. But I can't imagine how that would work script-side. Perhaps I'm missing the obvious though.
The "obvious" part is that v8.2 can only do reflection for one client per Simba process at a time (i.e. you can only run a single reflection script per simba window even with script tabs), the updates make every part of SMART functionality per script tab instead of per Simba process.
Brandon
2013-08-04 01:28:07
@BenLand100; Pairing is Nuked.
Smart on the OP is fine. Smart on the github is not. I will try to find the cause when I wake up.. Too tired atm.
Showing 2 Clients spawned and w/e.. Even with GetPIDs(False) and GetPIDs(True), it will always print 0.
BenLand100
2013-08-04 02:19:07
I mean, I wasn't done testing/hadn't started which is why i didn't release it or build binaries lol
E: pushed fixes to issues. should be back in business.
I've used the official binaries for SMART v8.2 from the first post and it works fine with RS3. I'm not sure if that is the version you pushed earlier today.
Le Jingle
2013-08-04 18:56:14
From: J J
I've used the official binaries for SMART v8.2 from the first post and it works fine with RS3. I'm not sure if that is the version you pushed earlier today.
I think the original post contains the stable version.
The new pushes/updates are all from on his github page.
Brandon
2013-08-04 19:50:23
Both are pretty stable.. I've been testing the new one on his github last night and today. Actually using it right now. No errors or problems :)
Decision
2013-08-05 16:02:38
Result := SmartSpawnClient(ReplaceWrap(PluginPath, '\', '/', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
I've changed that line in the Smartparams file. But I'm still receiving errors from that specific file.
When I'm trying to run a script (Preemptiblerunespan) I get the following error:
[Error] C:\Simba\Includes\SRL\SRL\misc\SmartParams.Simba(78:8): Unknown identifier 'RSReady' at line 77
Compiling failed.
Does anyone else has got this error or does anyone know a fix for this help will be very much appreciated.
Thanks and keep up with the good work.
BenLand100
2013-08-05 19:38:24
From: J J
I've used the official binaries for SMART v8.2 from the first post and it works fine with RS3. I'm not sure if that is the version you pushed earlier today.
Brandon was referring to the development version. v8.2 is working, fixed, and stable (won't be changed). At some point the development version will become a new version.
dexzar
2013-08-06 08:50:56
looks good, thanks for the amazing work again :)
Hoodz
2013-08-06 18:13:58
anyone got by coincidence the function: R_InFight?
Flight
2013-08-06 21:54:03
From: hoodz
anyone got by coincidence the function: R_InFight?
I believe it's possible at this point since somewhere I saw Brandon post all the hooking for NPCs. Now that I think about it all we need for this is determining if our player is interacting with a local NPC. But if you wanted to go further and tell if we're
attacking an NPC (to exclude things like random events) you'd need to gather all the local NPCs around you, find the one we're interacting with, and if that one is also in combat then we must be
attacking it.
Brandon
2013-08-06 23:37:46
From: hoodz
anyone got by coincidence the function: R_InFight?
I posted the hooks I had here:
http://villavu.com/forum/showthread.php?t=105118&p=1259880#post1259880I started re-writing my updater because it's way too unstable and running it on older jars finds way less hooks. A lot of my patterns were specific to Client Version:
#16 . Now that I started re-writing it, the Multipliers are a shit ton harder to find. Pretty hard to make it find the multipliers for all 16 jars. Finds fields just fine though. The previous way of finding multipliers was kinda hackish and pretty stupid but it worked.
Anyway, I think if you are looking for hooks you ought to post on that thread. Smart section really should be for Smart only questions. To get Infight you need to hook the loopcycle for actor and client.. I wasn't sure if my loopcycle was right so I commented it out in blue in the script below the hooks. You can try it and if it works then it works. If not, then you can probably get someone who has it to post it.
From: Brandon
I posted the hooks I had here: http://villavu.com/forum/showthread.php?t=105118&p=1259880#post1259880
I started re-writing my updater because it's way too unstable and running it on older jars finds way less hooks. A lot of my patterns were specific to Client Version: #16 . Now that I started re-writing it, the Multipliers are a shit ton harder to find. Pretty hard to make it find the multipliers for all 16 jars. Finds fields just fine though. The previous way of finding multipliers was kinda hackish and pretty stupid but it worked.
Anyway, I think if you are looking for hooks you ought to post on that thread. Smart section really should be for Smart only questions. To get Infight you need to hook the loopcycle for actor and client.. I wasn't sure if my loopcycle was right so I commented it out in blue in the script below the hooks. You can try it and if it works then it works. If not, then you can probably get someone who has it to post it.
You could always work on that PulseUpdater with myself and
@J J (wink wink, nudge nudge)
How did you find your multipliers? Did you just check the ldc by the getfield?
Brandon
2013-08-07 01:23:54
From: NKN
You could always work on that PulseUpdater with myself and @J J (wink wink, nudge nudge)
How did you find your multipliers? Did you just check the ldc by the getfield?
At first yes.. Just get your ass on
#SRLReflection channel on IRC..
Shatterhand
2013-08-07 09:41:43
Sometimes SMART opens up fine but it gets stuck in RSReady's loop.
Could not start up Old School RuneScape or RSReady was not detected!
Successfully executed.
In SetupSRL:
repeat
{$IFNDEF SIMBAMAJOR980}
{$IFDEF SMART}
If Smart_FixSpeed then
FixSmartSpeed;
{$ENDIF}
{$ENDIF}
Wait(100);
if (GetTimeRunning - t) > 120000 then
Break;
until(RSReady);
Here it calls RSReady and Simba gets stuck in its while loop.
function RSReady: boolean;
var
t : integer;
begin
Result := (LoggedIn);
if result then
exit;
if not Result then
begin
t := GetSystemTime() + 120000;
while GetSystemTime < t do
begin
Result := (GetColor(31, 488) = 16777215);
if result then
begin
SetAudioOff();
exit;
end;
wait(20+random(10));
end;
end;
Writeln('Could not start up Old School RuneScape or RSReady was not detected!');
TerminateScript;
end;
I checked the pixel on SMART, it was correct.

EDIT: Forgot to mention, this is 07.
EDIT2: I kept closing Simba+SMART, trying to start them again, without success. I was trying to running two Simba+SMART but only one of them worked at a time, the first one.
Reinstalled all my javas (jre 6 33, jre 7 21, jdk 7 21), installed jre 7 25 and jdk 7 25, restarted computer and now it works again.
Brandon
2013-08-07 10:18:46
Because RS ready no longer works on RS3. Those colours are for RS2. Smart's include should be independent of SRL's. Write your own or remove it from the include. This is an SRL problem not a smart one.
Shatterhand
2013-08-07 10:23:15
From: Brandon
Because RS ready no longer works on RS3. Those colours are for RS2. Smart's include should be independent of SRL's. Write your own or remove it from the include. This is an SRL problem not a smart one.
Sorry forgot to mention its 07.
Brandon
2013-08-07 14:28:39
From: Shatterhand
Sorry forgot to mention its 07.
Whether RS3, RS2, RSClassic, 07.. These are all includes that utilize Smart. Smart is only a provider of data. The includes are using it wrong, then you will get the errors you're getting. Such as hanging, etc.
Whoever wrote the RS07 include just did a direct copy of the RS2 one and changed some stuff in it. Like there isn't anything Benland can do to help the hanging since it is in the include.
Just change the colours or remove the RSReady completely and it won't hang.
Shatterhand
2013-08-07 17:18:43
From: Brandon
Whether RS3, RS2, RSClassic, 07.. These are all includes that utilize Smart. Smart is only a provider of data. The includes are using it wrong, then you will get the errors you're getting. Such as hanging, etc.
Whoever wrote the RS07 include just did a direct copy of the RS2 one and changed some stuff in it. Like there isn't anything Benland can do to help the hanging since it is in the include.
Just change the colours or remove the RSReady completely and it won't hang.
No it is not the include.
What I was trying to point out is it cannot read the color in that pixel. (the code I pasted into my first post and the picture under it)
It was someting SMART-Java related bug.
BenLand100
2013-08-07 19:58:46
From: Shatterhand
No it is not the include.
What I was trying to point out is it cannot read the color in that pixel. (the code I pasted into my first post and the picture under it)
It was someting SMART-Java related bug.
If it was a bug in SMART everyone would have that problem all the time. This sounds like user/include error, especially since restarting your computer and reinstalling java would not have fixed this problem (if it were a real problem). You were probably in the wrong graphics mode or something.
Le_don
2013-08-08 11:10:54
function R_OurLocation: Integer;
Result := R_GetTileGlobal.x and R_GetTileGlobal.y;
end;
I think I made a R_GetLocation function which should return your the current co-ordinates of you character.. hmm
From: Le_don
function R_OurLocation: Integer;
Result := R_GetTileGlobal.x and R_GetTileGlobal.y;
end;
I think I made a R_GetLocation function which should return your the current co-ordinates of you character.. hmm
That won't work lol did you even test it?
Le_don
2013-08-08 18:18:28
From: Officer Barbrady
That won't work lol did you even test it?
Nope, I was hoping somebody would actually tell me how to make it work :(
From: Le_don
Nope, I was hoping somebody would actually tell me how to make it work :(
Just use Writeln(R_GetTileGlobal); for debugging
Le_don
2013-08-08 18:31:45
From: Sjoe
Just use Writeln(R_GetTileGlobal); for debugging
Sjoe, I want to make sure my character is within a certain box of co-ords
From: Le_don
Sjoe, I want to make sure my character is within a certain box of co-ords
AreaBox := IntToBox(456,4,54,45); random coords :p
PointInBox(R_GetTileGlobal, AreaBox);
Brandon
2013-08-08 18:53:53
This is not the thread for that guys.. Come on now..
Le_don
2013-08-08 19:10:18
From: Brandon
This is not the thread for that guys.. Come on now..
There seemingly isn't a thread for this.
I'll try that Sjoe, thanks!
BenLand100
2013-08-08 19:53:14
From: Le_don
There seemingly isn't a thread for this.
I'll try that Sjoe, thanks!
So make one and stop hijacking.
From: BenLand100
So make one and stop hijacking.
Where is the love
arotane
2013-08-08 20:15:58
okay so I am new to simba and I was wondering if someone could make a new guide on how to setup simba and do everything cause the older one doesn't work for me or make a video it would be very much appreciated and if not could someone point me in the right direction on how to install properly or give me a link I just need something thank you
Le_don
2013-08-09 08:33:26
From: arotane
okay so i am new to simba and i was wondering if someone could make a new guide on how to setup simba and do everything cause the older one doesn't work for me or make a video it would be very much appreciated and if not could someone point me in the right direction on how to install properly or give me a link i just need something thank you
make a thread about this and stop hijacking.
djborec
2013-08-11 05:56:16
From: Kevin
I think we already have that. I think that was the following:
Disguise(str: String);
That also might have been changing the title on simba, but If I remembered the method name incorrectly, I'm still pretty sure it exists somewhere…
Its just changing simba name not SMART…
sal man
2013-08-19 19:12:57
Looks good thanks for the release
sloppyhole
2013-09-10 09:19:45
cant start scripts, will load osrs turn the sound off then stops then i get this message
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap]
Any reason why?
BenLand100
2013-09-10 10:11:01
From: sloppyhole
cant start scripts, will load osrs turn the sound off then stops then i get this message
The following DTMs were not freed: [SRL - Lamp bitmap, SRL - Book of Knowledge]
The following bitmaps were not freed: [SRL - Mod bitmap, SRL - Admin bitmap, SRL - Minimap Mask bitmap]
Any reason why?
> SMART loads fine
> still posts unrelated bug in SMART release thread
come on, seriously? make your own thread.
Khilosia98
2013-09-15 08:38:41
how do i add: Result = SmartSpawnClient(ReplaceWrap(PluginPath, '', '', [rfReplaceAll]), Params[0], ',' + Params[1], 765, 553, 's', '', '', '');
My smart client dosent open, help?
scribby
2013-09-15 15:46:03
Where is the tutorial on how to download this >.> I need this and the new smart params.
footballjds
2013-09-15 17:21:51
From: scribby
Where is the tutorial on how to download this >.> I need this and the new smart params.
go to the first post on the first page. Download: Official Binaries: SMARTv8.2.zip
unzip the contents.
Copy and paste(overwrite existing files) into: C:\Simba\Plugins
VALAH!