Page 4 of 6 FirstFirst ... 23456 LastLast
Results 31 to 40 of 53

Thread: sonic sword script need help

  1. #31

    Default

    Using Spell[1025].cast automatically checks for spell failures and will recast.

  2. #32

    Default

    Ok, figured something else out, forgot to add weapon type so only had two variables.
    That's why the script started to try and recast.

    Would this work:

    If script.vars[3]=="" then fput "You need 3 variables!" break

    added just after the line: target_id = nil and just before the comments?
    Last edited by Eliseen; 01-05-2021 at 07:55 PM.

  3. #33

    Default

    If you want to see if a variable doesn't have a value you can use nil.

    So you could do:

    Code:
    if script.vars[3].nil?
         echo "You need 3 variables."
         exit
    end

  4. #34

    Default

    Thanks, I'm slowly getting the hang of this. I was wanting to try the script out walking around town. So not to attack anyone's pets or familiars or such chose bats and balls as the critters. Forgot to add in a weapon, singing sword does not recognize bats as a weapon. It failed to cast twice (armor hindrance it said rolled a 7 and a 1) finally pulled up a broadsword as default.

    I figure if you do like I did and forgot to enter a weapon you would only have 2 variables # 3 would be nil, If you forgot all variables again #3 would be nil. Sort of a catch all. So I got all spelled up this evening so first thing in the morning I'm going to try it out. I think I may have all the bugs worked out, at least I hope so. Darn near ver 1.1.

    Again much thanks.

  5. #35

    Default

    Ok found a little glitch. If you die well it sort of goes off the deep end. How's this look


    if checkdead.nil?
    echo "program exiting."
    exit
    end

    And that would be in the main loop correct?

  6. #36

    Default

    Ok found a little glitch. If you die well it sort of goes off the deep end. How's this look


    if checkdead.nil?
    echo "program exiting."
    exit
    end

    And that would be in the main loop correct?

  7. #37

    Default

    Yeah just do:

    exit if dead?

  8. #38

    Default

    I've sent you a copy of the sonic sword script for your review. All parts seem to work (I haven't died to test that part out {yet}) If you can look it over and if you see where any improvements can be made or alterations or scripting errors. I've got all of them out. let me know if you think it's ready to share.

    Eliseen

  9. #39

    Default

    Quote Originally Posted by Eliseen View Post
    I've sent you a copy of the sonic sword script for your review. All parts seem to work (I haven't died to test that part out {yet}) If you can look it over and if you see where any improvements can be made or alterations or scripting errors. I've got all of them out. let me know if you think it's ready to share.

    Eliseen
    Looks good to me.

  10. #40

    Default

    I'm trying to understand the main attack sequence this is my English translation of the first line:

    fput "tell weapon to return" if Spell[1025].active? && !GameObj.npcs.find{ |i| i.name =~ /#{script.vars[1]}/ }

    send command "tell weapon etc" if spell 1025 is active and gameobj.npcs.find {|I| (looks to see if i.name appears somewhere in #{variable (script.vars[1]}

    I'm not sure what the vertical pipe is for |i| or the final / at the end are for

    Wait are /text/ the same as "text"
    Last edited by Eliseen; 01-19-2021 at 10:11 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •