PDA

View Full Version : Forge Perfect polishing Problem (Grabbing item # instead of item)



vamosj
02-02-2015, 02:57 AM
Okay, so I'm still having problems with Forge-perfects and hopefully someone out there has fixed this... The script is trying to grab item number instead of the item itself. So basically in game I see a command like " get #1235345 from my longcoat." I had to adjust the container because that was an issue also but I figured since only one of my character's forge changing this wouldn't be a problem for him. But now it hangs up on the polish because of trying to get the id number instead of the noun.


def polish
container = nil
unfinished = nil
GameObj.inv.each { |container| container.noun =~ /#{@average_container}|#{@keeper_container}/
break if unfinished = container.contents.find { |obj| obj.name =~ /rough|polished/ && obj.noun !~ /wand|shell|coral|ring|anklet|bracelet/ }
}
if unfinished != nil
echo ""
echo "Have a ##{unfinished.noun} that needs polishing."
echo ""
unless checkroom =~ /Workshop/
move "go door"
end
fput "get ##{unfinished.id} from longcoat" # replaced
fput "swap"
fput "lean polisher"
line = waitfor "rent on this workshop has expired", "You give the polishing wheel a shove"
waitrt?
if line =~ /rent on this workshop has expired/
move "out"
rent
fput "lean polisher"
elsif line =~ /You give the polishing wheel a shove/
waitfor "You straighten up from working at the polishing wheel"
waitrt?
end
fput "put #{unfinished.id} in longcoat"
else
sleep 1
end
end

Tillmen
02-02-2015, 02:13 PM
fput "get ##{unfinished.id} from longcoat"

should probably be

fput "get ##{unfinished.id}"

When using the object id, telling it what container to get it from cannot help (except for lockers). It can only make it fail if the object isn't in that container. In this case, it looks like the script is looking in two containers for objects to polish, so it might not be in the longcoat.

DaCapn
02-02-2015, 02:26 PM
Stating the origin container is unnecessary when using IDs. The ID is an absolute identifier of the item. No two objects will have the same ID.

You don't make it clear what the problem is once the script attempts to grab the item. I could not find what you were referring to? Please rephrase that command? If the error here is what I think it is (from looking at the block of code there), you've misrepresented the problem the syntax of the command sent to the game as well as the intent of the command. Actual details are always the way to go, rather than paraphrasing. This should give you the information you need to fix it, though:

The #{} sequence is used to insert a variable into a string. But in order for object IDs to be functionally used in-game, the ID number must be preceded by "#" (tap #12345678) so you'll see something like `fput "tap ##{object.id}"` where the first # is literal text. I sometimes see people say things like "you use ##{} for IDs and #{} for nouns" as if they are two different sequences. They're not. You use #{} to insert variables into strings whether they're IDs, nouns, or anything else. It's just that the game requires a numeric ID to be preceded by "#".

I see one error of this nature.

Tillmen
02-02-2015, 02:37 PM
Oh yeah. I didn't even notice the put command was missing a #. I was all focused on the get command. I suppose that could cause the get command to fail with "You need a free hand blah blah". If the script is hanging, it's probably hanging at the waitfor after "lean polisher". The script doesn't check if any of the other commands succeed or fail. I don't know much about forging, but I assume trying to polish something that's already been polished and you failed to put away would not result in either of the two lines it's waiting for.

ROTOR
02-02-2015, 03:05 PM
I was having a similar problem. There are a couple of differences between that code and mine. Haven't noticed any hang-ups with using this script since changing the keeper_container.


def polish
container = nil
unfinished = nil
GameObj.inv.each { |container| container.noun =~ /#{@average_container}|#{@keeper_container}/
break if unfinished = container.contents.find { |obj| obj.name =~ /rough|polished/ && obj.noun !~ /wand|shell|coral|ring|anklet|bracelet/ }
}
if unfinished != nil
echo ""
echo "Have a #{unfinished.noun} that needs polishing."
echo ""
unless checkroom =~ /Workshop/
move "go door"
end
fput "get ##{unfinished.id} from #{@keeper_container}"
fput "swap"
fput "lean polisher"
line = waitfor "rent on this workshop has expired", "You give the polishing wheel a shove"
waitrt?
if line =~ /rent on this workshop has expired/
move "out"
rent
fput "lean polisher"
elsif line =~ /You give the polishing wheel a shove/
waitfor "You straighten up from working at the polishing wheel"
waitrt?
end
fput "put ##{unfinished.id} in #{@keeper_container}"
else
sleep 1
end
end

vamosj
02-03-2015, 12:44 AM
All I know is it seems I'm attempting to fix issue after issue with Forge-perfects now and I suck at ruby.

Thanks for the help.

Fivel VonGrace
04-14-2015, 10:54 AM
>;forge
--- Lich: forge-perfects active.
--- Lich: error: forge-perfects:493: syntax error, unexpected ',', expecting ')'
multifput ("deposit all", "withdraw #{x} silver")
^
forge-perfects:493: syntax error, unexpected ')', expecting keyword_end
C:/Users/Steve/Documents/lich-4.6.14/lich/lich.rbw:2509:in `eval'
C:/Users/Steve/Documents/lich-4.6.14/lich/lich.rbw:2509:in `block (3 levels) in <class:Script>'
--- Lich: forge-perfects has exited.


I can't get it to run at all.....

Fivel VonGrace
04-14-2015, 04:35 PM
found the answer on another post!!!

Aeronal
05-01-2015, 10:43 PM
found the answer on another post!!!
care to share with the rest of us?

Dosselmeyer
05-07-2015, 06:32 PM
Where is this script? I used to use it all the time. Anyone still have a copy? Is there anything close to this available?

Wesley
05-07-2015, 06:54 PM
I wouldn't mind a copy either, if anyone has it.

Dosselmeyer
05-08-2015, 04:05 PM
--- Lich: forge-perfects active.
--- Lich: error: forge-perfects:493: syntax error, unexpected ',', expecting ')'
multifput ("deposit all", "withdraw #{x} silver")
^
forge-perfects:493: syntax error, unexpected ')', expecting keyword_end
C:/Users/Brian/Desktop/lich/lich.rbw:2509:in `eval'
C:/Users/Brian/Desktop/lich/lich.rbw:2509:in `block (3 levels) in <class:Script>'
--- Lich: forge-perfects has exited.


Anyone ever figure out how to fix this?

Fivel VonGrace
05-08-2015, 04:18 PM
http://forum.gsplayers.com/showthread.php?93845-Forge-Perfects-dosent-work-with-lich-4-6&highlight=forge-perfects