Hi everyone i been thinking of writing a guide to help to learn some basic coding to use with Xrteme.
First in ever and all scipt include atleast this line at the top of all your scripts
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
ImportScript ".\includes\LOTROService.vbs"
That call in some of wyvernx premade functions for us. the list of premade usable functions is/but not limit to after update.
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
sub VGSendText(strText) 'Get VG focus then send a text string (NO ENTER)
sub VGSendCommand(strCommand) 'Get VG focus then send a text string with ENTER
getPlayer() ' Returns a reference object to the player
getPlayerName() //Returns the Player's Name
getPlayerHeading() //Returns the Player's Heading
getPlayerZ() //Returns the Player's Z Coordinage
getPlayerY() //Returns the Player's Y Coordinage
getPlayerX() //Returns the Player's X Coordinage
getPlayerChunkX() 'Returns the map coords in chunk format.
getPlayerChunkY() 'Returns the map coords in chunk format.
getPlayerHealth() //Returns the Player's Health
getPlayerMaxHealth() //Returns the Player's Max Health
getPlayerDistanceTo(Mob) 'Returns the distance from the player to the mob
getTarget() ' Returns a reference object to the target
getTargetID() //Returns the Target SpawnID
getTargetName() //Returns the Target's Name
getTargetZ() //Returns the Target's Z Coordinage
getTargetY() //Returns the Target's Y Coordinage
getTargetX() //Returns the Target's X Coordinage
getTargetHealth() //Returns the Target's Health
getTargetDirection() //Returns the Player's Direction to the target
getTargetType() //Returns the Target's Type
getTargetDistance(Mob) '//Return the ingame distance to the mob from the player
setSearchDistance(distance) //Sets the distance for scanning for mobs (default is 40)
getNearestMobs(MobType) as ArrayList //Returns with an array of mob objects
getMob(Mob) ' Returns a byRef object that can be passed to functions
getMobID(Mob) //Returns the Mob ID
getMobName(Mob) //Returns the Mob Name
getMobX(Mob) //Returns the Mob X
getMobY(Mob) //Returns the Mob Y
getMobZ(Mob) //Returns the Mob Z
mobIsAttacking(Mob) '//Returns the true/false if mob is attacking something
getMobPoints(Mob) '//Returns the Mob Points Rating (1 = easy, 2 = normal, 3 = harder, etc)
getMobType(Mob) '//Returns the MobType (see globals)
getMobDistance(Mob) '//Return the ingame distance to the mob from the player
getMobDirection(Mob) '//Returns the heading degrees to the mob from the player
getMobIsAggro(Mob) 'returns true/false
getMobHealth(Mob) '//Returns the Mob Health
These are the functions and sub's that we can use that is made for us.
Ok now that we have the opening statement. Now we need to define our varables that will store items for the script to run. When u define a varable you define with with a
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Dim
for changing varables that change and
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
const
for varbles that never change
Our in this example is going to be "MAX_RUNS" and "Ta" (i just made the varable names up almost anything can be used)
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
const MAX_RUNS = 500000
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Dim Ta
Now we need to set a varable to these varables
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Ta = 0
ok now we will make a small scipt that sends find the nerest target and attack it with hotkey 1.
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
FOR Ta = 1 to MAX_RUNS
'(this tell the scripts runs what ever was defined in MAX_RUNS VARABLE)
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
FindATarget
'(this is calling a function that we have made up lower in the script find in lower down and see what it does.)
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
AttackTarget
'(this function attacks our target tills its dead)
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
NEXT
'(THIS TELL THE SCRIPT TO GO BACK THE FOR STATEMENT AND BEGINE AGAIN AND ADD ONE TO THE VARABLE Ta)
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Function FindATarget
VGSendtext "{backspace}" '(this uses the ingame hotkey backspace the target the nearest target)
sleep 500 '(this pauses the scipt for a half a sec to let this game to keep up)
end function '( you must end any function you make it kinda like a closer for a functions or sub. after it finishes this function it
'return to the mainloop area to do the next thing in line))
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
Function AttackTarget
do until getTargetHealth()<=0 '(this is saying do these thing inside this statement and the loop statement till your targets life is < or = 0 meaning it is dead)
VGSendtext 1 '(this send the keystroke of hotkey 1 to the game.)
sleep 1000 '(the pause for the skill/spell to recharge or it could be auto attack what ever)
loop '(this just tell the script to keep going back to the DO statement till it is what it wants)
end function '(this just closes the functions again and return to the main loop)
so the whole script would look like this
(!empty($user->lang['CODE'])) ? $user->lang['CODE'] : ucwords(strtolower(str_replace('_', ' ', 'CODE'))):
ImportScript ".\includes\LOTROService.vbs"
Dim Ta
const MAX_RUNS = 500000
Ta = 0
FOR Ta = 1 to MAX_RUNS
FindATarget
AttackTarget
next
Function FindATarget
VGSendtext "{backspace}"
sleep 500
end function
Function AttackTarget
do until getTargetHealth()<=0
VGSendtext 1
sleep 1000
loop
end function
Ok i hope this helps some how. If this one seems to help some i am going to write a few more on the other functions and how to use them.
BTW if i missed something please point it out i dont like miss leading anyone in the wrong direction
Danzar