Author Topic:  (Read 6762 times)

0 Members and 1 Guest are viewing this topic.

Offline Crome969Topic starter

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
« on: August 02, 2011, 10:36:09 PM »
0
Hello Scripuo Community,
do you know the Problem?
you want to walk in a specific amount of Tiles and must look at Charposition calulcate tiles or give a static Position?
Why cant this be a variable?
Today i want to show you a small Solution:

Code: [Select]
--########################################
--@Name          MoveTiles
--@Author        Crome696
--@Purpose       Move in looking direction or reversed direction
--@ReleaseDate 08\01\11
--@Version        1.0
--@TestedClient 7.0.16.1
--@TestShard    Osi\Osiclone
--########################################           
function MoveTiles(tmpTiles,tmprev,tolerance,timeout)
dir = UO.CharDir + 1
rev = {5,6,7,8,1,2,3,4}
if(tmprev==true)then tmpdir = rev[dir] else tmpdir = dir end
mpath = {}
mpath[1] = {(UO.CharPosX ),(UO.CharPosY - tmpTiles)}
mpath[2] = {(UO.CharPosX + tmpTiles),(UO.CharPosY - tmpTiles)}
mpath[3] = {(UO.CharPosX + tmpTiles),(UO.CharPosY)}
mpath[4] = {(UO.CharPosX + tmpTiles),(UO.CharPosY + tmpTiles)}
mpath[5] = {(UO.CharPosX ),(UO.CharPosY + tmpTiles)}
mpath[6] = {(UO.CharPosX - tmpTiles),(UO.CharPosY + tmpTiles)}
mpath[7] = {(UO.CharPosX - tmpTiles),(UO.CharPosY - tmpTiles)}
mpath[8] = {(UO.CharPosX - tmpTiles),(UO.CharPosY - tmpTiles)}
UO.Move(mpath[tmpdir][1],mpath[tmpdir][2],tolerance,timeout)
end

This function will move your Char in specific Tiles forward or reversed.

[/URL]
Example:
Code: [Select]
MoveTiles(1,false,0,0)You are Looking in Chardirection "0" then it will move 1 Tile in direction 0 without a timeout and 0 tiles tolerance
Code: [Select]
MoveTiles(1,true,0,0)Now reversing is enabled so it will move 1 tile in Chardirection 4 (Opposite of 0, view Picture)
if you set tolerance > 1 it will be done with moving if Char is within the tolerance range to wanted Tile Range.
If you set timeout >1 Moving is finished when it reached time > timeout seconds.

Usage:
In some of my Scripts i need to runaway from target. Like you need to heal or lure Monsters away. So you can use this function to move away.
Other Usage is maybe in Tilebased Skilling Scripts. you now dont need to look on your Charposition and calculate 8 tiles just use:
Code: [Select]
MoveTiles(8,true,0,0)
Hope it will be Useful for you guys,too.

Kind regards

Crome

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6206
  • Activity:
    3.2%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +274
  • Referrals: 3
    • View Profile
« Reply #1 on: August 03, 2011, 07:40:02 AM »
0
Very nice - is this in openEUO?

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
« Reply #2 on: August 03, 2011, 08:13:14 AM »
0
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline Crome969Topic starter

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
« Reply #3 on: August 03, 2011, 08:49:43 AM »
0

Offline gimlet

  • Very Super Secret
  • Global Moderator
  • *
  • *
  • Posts: 6206
  • Activity:
    3.2%
  • Reputation Power: 71
  • gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!gimlet is awe-inspiring!
  • Gender: Male
  • Respect: +274
  • Referrals: 3
    • View Profile
« Reply #4 on: August 03, 2011, 09:28:16 AM »
0
Can you call an open euo function from euo (or vis versa)


Offline Crome969Topic starter

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
« Reply #5 on: August 03, 2011, 09:41:50 AM »
0
Can you call an open euo function from euo (or vis versa)
well you can make a library file and Open it Via
dofile(getinstalldir().."Yourpathandfolderns..\yourlibraryfile.lua")
so i handle it like:


dofile(getinstalldir().."Library\finditem.lua")
dofile(getinstalldir().."Library\crome_base.lua")
dofile(getinstalldir().."Library\crome_Login.lua")
dofile(getinstalldir().."Library\Sending.lua")
dofile(getinstalldir().."Library\Crome_Tamer.lua")

and atleast.. all these just staying once in a file named "Init.Lua" in my Main Openuo Folder
and then i call
dofile(getinstalldir().."Init.lua")
and that file calls those Library files.
And i can use em in my script with just 1 Line in every new Script.

But if you mean OUO in EUO i must disapoint you.
Openuo uses lua, Easyuo dont know what lua is.
Maybe if you write an Integration for Luasyntax you could.
But before you do that. Do Openuo:):)

Offline Goliath

  • Sr. Member
  • *
  • Posts: 424
  • Activity:
    0%
  • Reputation Power: 5
  • Goliath has no influence.
  • Gender: Male
  • Respect: +37
  • Referrals: 2
    • View Profile
« Reply #6 on: August 03, 2011, 06:03:47 PM »
0
Nice work

Tags: