View Full Version : Forge-perfects problem
budartagnan
01-15-2012, 09:38 PM
I've been using the forge-perfects script, and it works great. However, I'm hung up on a spot now and I'm not sure how to fix it. I've tried a few things and just bork the script (since I have no idea what I'm doing). Hoping someone can give me a hand here. Failing that, a resource for learning the language would help.
It's hanging up in this section:
def buy(item, material=nil)
line = ""
until line =~ /hands you/
if @town == nil
location
end
if material
if Char.citizenship == @town
cost = dothis "order #{item} material #{material}", /Since you\'re a citizen of this town, I\'ll drop the price to (\d+)\./
else
cost = dothis "order #{item} material #{material}", /(\d+) silvers\./
end
cost = cost.slice(/[0-9]+/).to_i
else
if Char.citizenship == @town
cost = dothis "order #{item}", /Since you\'re a citizen of this town, I\'ll drop the price to (\d+)\./
else
cost = dothis "order #{item}", /(\d+) silvers\./
end
cost = cost.slice(/[0-9]+/).to_i
end
fput "buy"
line = waitfor "buckle under", "hands you", "do not have"
abort! if line =~ /buckle under/
if line =~ /do not have/
bank(cost+Rent)
end
It works when she says the following:
You banter a bit with Samilla but sense you aren't getting very far in your bargaining. Samilla says, "But Tiondra! I have to make a living, you must realize! I could not go below 7875 silvers."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
However, it hangs up if she says this:
Putting on your best bargaining face, you launch into a bit of haggling with Samilla. "My good friend!" she exclaims, "surely you would not cheat a noble merchant as myself out of her life's work! I'll take 7875 silvers, but only for you." Despite Samilla's protestations, she seems not displeased.
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
m444w
01-15-2012, 09:58 PM
indefinite wait, or is there an actually ruby error message?
budartagnan
01-15-2012, 10:28 PM
Indefinite wait. If I manually input "order 8" again until the below shows up it'll start up again.
You banter a bit with Samilla but sense you aren't getting very far in your bargaining. Samilla says, "But Tiondra! I have to make a living, you must realize! I could not go below 7875 silvers."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
EDIT: Just happened to me. Here's the deal:
[forge-perfects original]>out
>
You notice some forging workshops, a wooden sign, the clerk Samilla and a large placard.
Obvious paths: south
>
[forge-perfects original]>order 9
You try to strike up some conversation before getting down to business, but Samilla will have none of it. Samilla says, "I can see you have a sharp mind indeed. Perhaps 7875 silvers would satisfy your intellect? Final offer."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>order 9
You try to strike up some conversation before getting down to business, but Samilla will have none of it. Samilla says, "I can see you have a sharp mind indeed. Perhaps 7875 silvers would satisfy your intellect? Final offer."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>order 9
Putting on your best bargaining face, you launch into a bit of haggling with Samilla. "My good friend!" she exclaims, "surely you would not cheat a noble merchant as myself out of her life's work! I'll take 7875 silvers, but only for you." Despite Samilla's protestations, she seems not displeased.
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>order 9
You try to strike up some conversation before getting down to business, but Samilla will have none of it. Samilla says, "I can see you have a sharp mind indeed. Perhaps 7875 silvers would satisfy your intellect? Final offer."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>order 9
Putting on your best bargaining face, you launch into a bit of haggling with Samilla. "My good friend!" she exclaims, "surely you would not cheat a noble merchant as myself out of her life's work! I'll take 7875 silvers, but only for you." Despite Samilla's protestations, she seems not displeased.
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>order 9
You banter a bit with Samilla but sense you aren't getting very far in your bargaining. Samilla says, "But Tiondra! I have to make a living, you must realize! I could not go below 7875 silvers."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
>
[forge-perfects original]>buy
But you do not have enough silver!
Gizmo
01-15-2012, 10:35 PM
Indefinite wait. If I manually input "order 8" again until the below shows up it'll start up again.
You banter a bit with Samilla but sense you aren't getting very far in your bargaining. Samilla says, "But Tiondra! I have to make a living, you must realize! I could not go below 7875 silvers."
Samilla says, "Since you're a citizen of this town, I'll drop the price to 7087."
Moredin recently returned to the game, and made this script.
The other night on lnet he was asking if any problems arose with it lately since he's been gone. May wanna try to get ahold of him when he's in game and ask/tell him about it also.
Philiater
01-16-2012, 07:09 PM
ok first, here's the relevant part of the script:
if Char.citizenship == @town
cost = dothis "order #{item}", /Since you\'re a citizen of this town, I\'ll drop the price to (\d+)\./
else
cost = dothis "order #{item}", /(\d+) silvers\./
end
the line in the game that you said works will work with this line but the others will not. why? because of that itty bitty little period at the end. BUT that period needs to be there, I promise you. if you simply removed the period there might be a chance that after many cycles of the script you might have a huge surplus of silvers (ie each time you will withdraw 7875 when you only need 7087)
So here's the REAL problem. you're obviously a citizen in the town in which you're forging. the bolded line I pointed out is what the script is supposed to match to the game line when you're NOT a citizen. for some reason I havent yet figured out, the script doesn't realize that you're a citizen. I haven't used the script in awhile so I need to take a look at it closer, but my GUT tells me the forge is not IN the town "location".
let me take a closer look. but can you tell me the room number Samilla is in and your town of citizenship? also could you tell me what it says when you type "location" in that room?
Philiater
01-16-2012, 07:21 PM
yeah right now forge-perfects does not account for forges that are outside of towns. here's how it checks:
def location
done = false
action = proc { |server_string|
if server_string =~ /You carefully survey your surroundings and guess that your current location is (.*) or somewhere close to it\./
@town = $1
DownstreamHook.remove('location_check')
done = true
nil
else
server_string
end
}
DownstreamHook.add('location_check', action)
put 'location'
wait_until { done }
end
so basically what you get when you type ";e echo Char.citizenship" is not matching up with what you get when you type "location", when it should be since you're given citizenship privileges in that forge. the forge must be outside town or in a different "location".
I need specifics about what town you're in and the "location" of the room Samilla is in before I can fix that without breaking something else.
budartagnan
01-16-2012, 10:20 PM
let me take a closer look. but can you tell me the room number Samilla is in and your town of citizenship? also could you tell me what it says when you type "location" in that room?
Samilla is in room number 8618. This is in the landing.
>citizen
You currently have full citizenship in Wehnimer's Landing.
>location
You carefully survey your surroundings and guess that your current location is Wehnimer's Landing or somewhere close to it.
I actually went to get citizenship with this character hoping that it would fix the issue. It did the same before the character was a citizen of WL too.
Philiater
01-16-2012, 10:29 PM
oh...damn. I will fix this...I think I was thinking about it backwards.
Philiater
01-17-2012, 04:53 PM
I still am not sure what went wrong exactly, but I made a few changes; nothing fundamentally is different, but i changed a few variables and the way location is checked. also made it type "citizenship" just in case infomon didnt already have that data or something screwy like that.
just tested it on a character that has citizenship in the Landing and a character that did not have citizenship and it matched the correct line each time (i echoed the results to be sure).
I just uploaded the updated version so give it a try and let me know if it works for you.
budartagnan
01-17-2012, 09:31 PM
:thanx: :bouncing:
Works great!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.