Author Topic: the beginnings  (Read 11585 times)

0 Members and 1 Guest are viewing this topic.

Offline SunTigressTopic starter

  • TopTwo's Woman
  • Elite
  • *
  • *
  • Posts: 900
  • Activity:
    0%
  • Reputation Power: 9
  • SunTigress has no influence.
  • Gender: Female
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: the beginnings
« Reply #30 on: July 30, 2009, 03:09:04 PM »
0
I'm not helping you help me, am I? I am sorry, I do appreciate your help.

I tried switching it from namedrunebook to runebook with runebok ids and with runebook names. It is as if it goes to your sub, and then just stops. but, i want to do a lot of F8s through your example to see how it goes through your subs. will let you know what i find
If at first you don't succeed, try try again. Then give up. There is no use in making a fool of yourself.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: the beginnings
« Reply #31 on: July 30, 2009, 03:10:40 PM »
0
you should update your code so I can see where you are at.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: the beginnings
« Reply #32 on: July 30, 2009, 03:21:42 PM »
0
well, i thought right there, where is says

set %currentBookID %_runebook . %currentSet

i thought that would move my ids into the gosub TM_travel

Well, you'll have to do some research on the "dot" operator.  Frankly, that's a bit more advanced subject so you should probably steer clear of that until you get some of the basics down.  So just delete that line.... ;)

I cleaned up your first few lines: 
Code: [Select]
;~~~~~~~~~~~~~~~~~~~~~~~~Runebooks~~~~~~~~~~~~~~~~~~~~~~
GoSub setup_secure_runebook
GoSub setup_feather_runebooks
GoSub setup_travel
GoSub setup_secure
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;Main loop
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
repeat
  GoSub Harpies
until #false
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;subs
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub Harpies
  set %currentBookID %featherrunebookid
  GoSub TM_TravelFromRunebook %travel_method %currentRune 16 %currentBookID
return



Please read the ScriptUO site RULES
Come play RIFT with me!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: the beginnings
« Reply #33 on: July 30, 2009, 03:25:55 PM »
0
Oh, take a look at your %currentRune value, it's not initialized.  You should probably set that in setup....
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline SunTigressTopic starter

  • TopTwo's Woman
  • Elite
  • *
  • *
  • Posts: 900
  • Activity:
    0%
  • Reputation Power: 9
  • SunTigress has no influence.
  • Gender: Female
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: the beginnings
« Reply #34 on: July 30, 2009, 03:33:57 PM »
0
ok, added the %currentrunevalue for the books. i am going to update my code in my original post. couldn't i use the example you gave me to put my two runes into one runebook, and just make whoever uses the script set their own runebookid? (or later write in a way so they just have to target their rune book?)
If at first you don't succeed, try try again. Then give up. There is no use in making a fool of yourself.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: the beginnings
« Reply #35 on: July 30, 2009, 03:40:48 PM »
0
Well you already have those setup routines in there to target the runebooks.  That's what this code does:

Code: [Select]
sub setup_secure_runebook
display Target your secure Rune Book
  wait 1
  set #targcurs 1
  while #targcurs = 1
    wait 0
set %securerunebookid #ltargetid
set %currentrunevalue 1
return

sub setup_feather_runebooks
display Target your feather Rune Book
  wait 1
  set #targcurs 1
  while #targcurs = 1
    wait 0
set %featherrunebookid #ltargetid
set %currentrunevalue 1
return

What you have is very close now.  Just tweak your harpies sub:

Code: [Select]

sub harpies
    set %currentbookid %featherrunebookid
    set %currentRune %currentrunevalue ; need to set %currentRune
    GoSub TM_TravelFromRunebook %travel_method %currentRune 16 %currentbookid
return
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline SunTigressTopic starter

  • TopTwo's Woman
  • Elite
  • *
  • *
  • Posts: 900
  • Activity:
    0%
  • Reputation Power: 9
  • SunTigress has no influence.
  • Gender: Female
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: the beginnings
« Reply #36 on: July 30, 2009, 03:49:19 PM »
0
TM, I did what you said, and of course it worked. But, I want to understand why it worked.


sub harpies
    THIS -> set %currentbookidcame from THIS -> %featherrunebookid which i set in my setup?
   same with this -> set %currentRune coming from this ->%currentrunevalue ; need to set %currentRune
       GoSub TM_TravelFromRunebook %travel_method %currentRune 16 %currentbookid
return


so, later when i want to go home i can use basically the same thing but change %featherrunebookid to %securerunebookid because it is using the securerunebookid to set the currentrunebookid, which is that specific sub?
« Last Edit: July 30, 2009, 03:53:38 PM by SunTigress »
If at first you don't succeed, try try again. Then give up. There is no use in making a fool of yourself.

Offline SunTigressTopic starter

  • TopTwo's Woman
  • Elite
  • *
  • *
  • Posts: 900
  • Activity:
    0%
  • Reputation Power: 9
  • SunTigress has no influence.
  • Gender: Female
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: the beginnings
« Reply #37 on: July 30, 2009, 04:12:37 PM »
0
after having that lightbulb come on, i get it. i changed my code so that i only have one runebook now. code updated  :D
If at first you don't succeed, try try again. Then give up. There is no use in making a fool of yourself.

Scrripty

  • Guest
Re: the beginnings
« Reply #38 on: July 30, 2009, 04:54:28 PM »
0
after having that lightbulb come on, i get it. i changed my code so that i only have one runebook now. code updated  :D

We were just talking the other night about staring at code until you have divine intervention and you just, "get it." haha

Offline _C2_

  • AFK FtW
  • Global Moderator
  • *
  • *
  • Posts: 4077
  • Activity:
    0%
  • Reputation Power: 48
  • _C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!_C2_ has great potential!
  • RIP Pen Trick
  • Respect: +254
  • Referrals: 4
    • View Profile
Re: the beginnings
« Reply #39 on: July 30, 2009, 04:57:32 PM »
0
if u stare long enough, it all turns green and letters and numbers start falling downward on the screen like matrix.  humm.. or was that from something else?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13303
  • Activity:
    0.4%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: the beginnings
« Reply #40 on: July 30, 2009, 05:50:40 PM »
0
after having that lightbulb come on, i get it. i changed my code so that i only have one runebook now. code updated  :D

I'm glad you got it!

I guess the best lesson you can take away from this is a script doesn't write itself.  If you don't initialize a variable, then it just won't have anything in it.  That's why I was stressing KNOWING what a variable has in it before you rely on that value for anything.  Frankly, I have problems all the time when I *think* I have a value in a variable only to find it wasn't what I thought.

Also since scripts run in a linear fashion, just because you have the variable set somewhere in the code doesn't mean it was executed yet.  So you start at line 1, then to line 2, and so forth.  You might take diversions because of a gosub, goto, while, for or repeat.

Just remember that a script or program execute in a linear fashion and it ALWAYS does just what you tell it.  Even when you tell it to do the wrong thing.  Bugs suck that way.

Scripts and programs have a flow, and you are in total control over that flow.
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: the beginnings
« Reply #41 on: July 30, 2009, 06:28:10 PM »
0
You should really start with basics.  That helped me a ton.  Write simple scripts.  Like first start with attacking a harpy and killing it.  Then skin the corpse.  Then get that working, then open the corpse and loot the feathers.  At that point you have a fully functioning feather farmer.  It will attack harpy's and loot them of feathers.  Now just start adding the features you like, one at a time.  Recalling, rails, all that.  And don't make rails difficult... you can make explicit rails that do what you want them to do EASILY. :)  They aren't hard.  I'd have started with what I want the script to DO first.  That's kill harpies and loot feathers. :)  Everything else is fluff.  When I started on my script I started with a bare bones casting sub.  That's it.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: the beginnings
« Reply #42 on: August 01, 2009, 06:40:48 AM »
0
Scripts and programs have a flow, and you are in total control over that flow.


Just go with the Flow man..... (said while smoking a fat one)


... wait thats not it at all... you are the flow... feel the force Luke... (or in your case Leia)
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline Hoby

  • Elite
  • *
  • *
  • Posts: 1344
  • Activity:
    0%
  • Reputation Power: 14
  • Hoby barely matters.Hoby barely matters.
  • Gender: Male
  • Respect: +79
  • Referrals: 1
    • View Profile
Re: the beginnings
« Reply #43 on: August 04, 2009, 12:12:31 AM »
0
Congrats on your first script.  Sounds like your getting it down.  I'm almost tempted to try to write one myself, but, I get the outline of it done then lose interest.  My add (adhd) whatever it is kicks in.  Oh something shiny.......dam, did it agian.  JK.  Way to go on your scripting. 
I like you, your death shall be quick and painless!!
I may have alzheimers, but at least I don't have alzheimers.
Walruses are like vampires, only awesome
Pwned-The total domination or shut down of a person or thing. 
I believe a hangover is gods way of saying you kicked ass last night!
Life's to short to remove usb safely.

Tags: