Author Topic: My first scrip and need help seting it up  (Read 11169 times)

0 Members and 1 Guest are viewing this topic.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
My first scrip and need help seting it up
« on: August 18, 2011, 09:01:19 AM »
0
Hello,
this is my first scrip i have ever attempted to do. I know what i want it to do but i don't know how to set it up.
What i want it to do is:

Code: [Select]
Find fishing pole (code XHF)
Double click it
Click 2 titles infront of chr
wait 8s
Look for fish caught
if none found repeat
if found move fish to hold on new boat that is X 471 Y 310
then repeat
If shoe is caught then
drop on ground
then repeat
if mob is caught
say all guard me
then when dies look for MIB
if found MIB move to hold
then repeat
if no MIB found
repeat
if white pear is caught
then move to hold
then repeat
if that scale thing is caught
drop on ground
then repeat
after that is all checked then
check health
if damaged
Cast Greater Heal
Then repeat
if full health
Then repeat
Check my Vollem Health
if full
repeat
if dammaged
cast greater heal on it
then repeat
then say forward one
then start over again

That is what i want it to do I have no clue how to set it up to do all that can anyone help me?
Fish codes are:
SMZ TYZ EQD NMZ WYZ DQD OMZ RMZ GQD UYZ FQD ZYZ TYZ
White Pearl code
WWS
Where i want to tarket is
X 352
Y 382
My location
X 405
Y 315
Hold location is
X 471
Y 310
MIB Code
HTD (but thats that aquairm one i think they are the same)
That is what i want the script to do i just have no clue how to get it to do that
can anyone help me set it up?
« Last Edit: August 18, 2011, 09:19:51 AM by Cerveza »
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

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
Re: My first scrip and need help seting it up
« Reply #1 on: August 18, 2011, 09:22:50 AM »
0
Just start breaking it down into code...

"Find fishing pole (code XHF)"

finditem XHF C_ , #backpackID ; find it in backpack

"Double click it"

set #lobjectID #findID ; sets last object to the last item found
event macro 17 ; uses last object

"Wait for target cursor"

target 3s ; you didn't have this but I know you want it

and just keep on going like that... test it with each part you add to make sure that part is working correctly.
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 NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #2 on: August 18, 2011, 10:28:32 AM »
0
Ok running into a problem how do i select the ground in front of me?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

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
Re: My first scrip and need help seting it up
« Reply #3 on: August 18, 2011, 11:00:33 AM »
0
You need to know where you are. Then add/subtract to get to where you want to cast or target.

When testing try this... stand where you want to be and note your #charposX and #charposY. Then move to where you want to target and note the NEW #charposX and #charposY. Now look at the relationship between the sets of numbers. You'll see what you have to do....

And have a loot at ltargetKIND over at easyuo documentation.
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 Guadah

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: My first scrip and need help seting it up
« Reply #4 on: August 18, 2011, 11:04:17 AM »
0
This may or may not work, but it's where I would start.

Code: [Select]
set %xpos ( #charposx + 1 ) ; sets the variable %xpos as one spot north
set %ypos ( #charposy + 1 ) ; sets the variable %ypos as one spot east
set %target ( %xpos + %ypos ) ; sets the variable %target as one spot north and one spot east
set #ltargetid %target ; sets the last target as %target, which is one spot north, one spot east.
event macro 22 0 ; targets last target

Again, this is just a guess but is where I would start troubleshooting.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #5 on: August 18, 2011, 11:16:34 AM »
0
You need to know where you are. Then add/subtract to get to where you want to cast or target.

When testing try this... stand where you want to be and note your #charposX and #charposY. Then move to where you want to target and note the NEW #charposX and #charposY. Now look at the relationship between the sets of numbers. You'll see what you have to do....

And have a loot at ltargetKIND over at easyuo documentation.

since i want to be moving in this script is there a way to do this

set  %Water #Charposx +2 #Charposy -1 #Charposz -7
so that as i change location it will keep choising the target infront my feet in the water?
« Last Edit: August 18, 2011, 11:20:04 AM by NecroFox »
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

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
Re: My first scrip and need help seting it up
« Reply #6 on: August 18, 2011, 11:21:56 AM »
0
Almost, you have to remember when you set a variable it is setting A variable...

set %waterX ( #charposX + 2 )
set %waterY ( #charposY + 2 )

Then later when you want to click it....

click %waterX %waterY
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 NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #7 on: August 18, 2011, 11:22:49 AM »
0
Tyvm I know i fill find more questions to ask as i go
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #8 on: August 18, 2011, 11:27:46 AM »
0
ok when i run it all it does is clicks pole and then dosent click the water the code so far is

Code: [Select]
;This script is my first one ever and i hope it is done correctly.
;If anyone knows how to make it flow better please help.
;I is supost to fish infrount of you then place fish, MIB and Pearls into hold
;Then move forward one. then repeat.

;Seting the different things
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
;Set %Scale to be added don't know code yet
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet TULKGF
Set %waterX ( #charposx -1 )
Set %waterY ( #charposy +2 )
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold

Finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17
click %waterX %waterY
wait 8s
« Last Edit: August 18, 2011, 11:34:51 AM by NecroFox »
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline Guadah

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: My first scrip and need help seting it up
« Reply #9 on: August 18, 2011, 11:52:53 AM »
0
You need to wait for your target curser to appear before you click.

Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #targcurs = true
      {
       wait 1
       }
click %waterX %waterY
wait 8s

Edit #1
After I submitted this I looked at what I wrote, and since you only have one line after the 'while #targcurs = true', you should be able to take out the { and } and have this:


Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #Targcurs = true
       wait 1
click %waterX %waterY
wait 8s

Which looks cleaner and has 2 less lines.  You'll appreciate the ability to shorten your scripts once you get one that goes over 1000 lines.

That is how I would look to work it.

Edit #2
Thinking post submit again.  You probably don't understand some of what is there.  After you have a statement like 'while blah blah blah' anything that is within the { and } will be what is performed until your 'while' statement comes true.

So if you set your '#targcurs = 1' that will give you a target curser.  Anything in the { and } will be performed until you target something to make it = 0.

So if you did:


Code: [Select]
finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #Targcurs = true
      {
       wait 1
       event macro 1 0 I love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       }
click %waterX %waterY
wait 8s

This will set your curser as 1, and while waiting for you to target it will pause 1 second, say "I love fishing..." and salute over and over and over until you target.  Now I don't recommend this, but you get the idea of what the purpose is.
« Last Edit: August 18, 2011, 12:02:34 PM by Guadah »

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #10 on: August 18, 2011, 12:07:34 PM »
0
It is still just clicking the pole and not clicking the water it keeps the target hand up
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

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
Re: My first scrip and need help seting it up
« Reply #11 on: August 18, 2011, 12:08:57 PM »
0
And have a loot at ltargetKIND over at easyuo documentation.

Have you done this already??

You need to set a last target....

set %ltargetX %waterX
set %ltargetY %waterY

event macro 22 ; last target

btw, I have an old sub that would work great for this, but would prefer you figure it out ;)
« Last Edit: August 18, 2011, 12:11:20 PM by Cerveza »
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 Guadah

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: My first scrip and need help seting it up
« Reply #12 on: August 18, 2011, 12:14:15 PM »
0
Going to be a little cryptic here, but I want you to think some, best way to learn!

#charposy + 2  (This is where your problem is.  Compare yours to what I wrote)

It's amazing what missing a space can do.  ALWAYS be careful about where you are putting, or not putting spaces, comma's and for that matter... any character.

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #13 on: August 18, 2011, 12:35:09 PM »
0
And have a loot at ltargetKIND over at easyuo documentation.



do what?
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Offline NecroFoxTopic starter

  • Jr. Member
  • **
  • Posts: 58
  • Activity:
    0%
  • Reputation Power: 1
  • NecroFox has no influence.
  • Gender: Male
  • Respect: +1
  • Referrals: 2
    • View Profile
Re: My first scrip and need help seting it up
« Reply #14 on: August 18, 2011, 12:40:12 PM »
0
i don't want to look at your fishing script but so far i have
Code: [Select]
Set %FishType SMZ_TYZ_EQD_NMZ_WYZ_DQD_OMZ_RMZ_GQD_UYZ_FQD_ZYZ_TYZ_
Set %Pole XHF_
Set %White_Pearl WWS_
Set %Shoes PVI_TVI_AWI_NVI_OVI_ZVI_CWI_QVI
Set %Scale UDHB_
Set %MIB HTD
Set %Special_Fish YDF_
Set %Pet1 TULKGF
Set %Pet2
Set %waterX ( #charposx - 2 )
Set %waterY ( #charposy + 2 )
Set %Cargo_Hold CJF ;Tokno Ship Cargo Hold


finditem %Pole C_, #backpackID
set #lobjectID #findID
event macro 17 0
set #targcurs = 1
while #targcurs = true
      {
       wait 1s
       event macro 1 0 love fishing... ; (Event Macro 1 0 lets you 'say')
       event macro 19 0 ; (this will make you salute)
       }
click %waterX %waterY
wait 8s
stop

it doesnt say the love fishing...
or the salute
Sorry for spelling I hate spelling and im really bad at it
----------------------------------------------------
New to writing Scripts need Help accepting from all.
Good Learner
----------------------------------------------------
The Fox is cunning so watch your back....

Tags: