PDA

View Full Version : Scripting Help


Cybnext_Design
08-19-2001, 01:54 PM
I am trying to make a script where it takes your ATM Account and puts every number in a different tempstring like this:

say the ATM Account has 1 million dollars in it.

baccount1=1
baccount2=0
baccount3=0
baccount4=0
baccount5=0
baccount6=0
baccount7=0

And let me remind you that this ATM Account will change in amount.

And i know how to to do this with a 3 digit number but everything i try never works on a 7 digit number.

Can anyone help?

Falcor
08-19-2001, 02:10 PM
En Ingles Por Favor?
No Comprendo tu Pregunta.
====================
In Englsh please?
I dont understand your quesiton =\

Falcor
08-19-2001, 02:13 PM
I mean you can get certain digets. Such as if ytou want the thousands you can do...

(number/1000 - (number/1000)%1)%10

Cybnext_Design
08-19-2001, 02:24 PM
Thanks that script worked quite nicely.

Cybnext_Design
08-19-2001, 03:09 PM
Nevermind...that script end up not working all the time, i had my bank account set at 999900 and it displayed 1998900.

Could you maybe tell me what is wrong?
here is what i did with the scrip that you gave me.


baccount=strtofloat(#s(bankaccount));
baccount1=int((baccount/1000000-(baccount/1000000)%1)%10);
baccount2=int((baccount/100000-(baccount/100000)%1)%10);
baccount3=int((baccount/10000-(baccount/10000)%1)%10);
baccount4=int((baccount/1000-(baccount/10000)%1)%10);
baccount5=int((baccount/100-(baccount/100)%1)%10);
baccount6=int((baccount/10-(baccount/10)%1)%10);
baccount7=int((baccount/1-(baccount/1)%1)%10);

LiquidIce00
08-19-2001, 09:34 PM
i know how sir
use #e
also im using an array so to get a value u would do baccount[1] instead of baccount1
(and it starts at 0 not 1)

if (playerenters) {
setarray baccount,strlen(#s(bankaccount));
for (this.i=0;this.i<strlen(#s(bankaccount));this.i++) {
baccount[this.i]=strtofloat(#e(this.i,1,#s(bankaccount)));
}
}

LiquidIce00
08-19-2001, 09:44 PM
Originally posted by Kaimetsu


Correct except for the fact that he said that he wanted them in strings. Still pretty easy to adapt your code, though.


in string

if (playerenters) {
for (this.i=0;this.i<strlen(#s(bankaccount));this.i++) {
setstring baccount#v(this.i),strtofloat(#e(this.i,1,#s(banka ccount)));
}
}

LiquidIce00
08-19-2001, 09:48 PM
Originally posted by Kaimetsu


Indeed. Except also he probably wants the original bankaccount to be a variable rather than a string.
SHUT THE FUC* UP
IN GRAAL THERE IS STRING AND NUMERICAL VARIABLES
SO IF HE WANTS TOO BAD CUZ U CANT DO NETHING BOUT IT
u say the stupidest things

LiquidIce00
08-19-2001, 10:01 PM
Originally posted by Kaimetsu


Why so angry? I never attacked you, I just said that he'd probably want it a different way. Can you perhaps read his mind? Do you know exactly what he wants? If not then how can you shout at me for making an interpretation when you did the very same thing?

too bad ur dumb
if u read the whole thread u would of stfu cuz i answered his Q

LiquidIce00
08-19-2001, 10:43 PM
Originally posted by Kaimetsu


Uh... no. He didn't specify whether the original number was a variable or a string. And why are you lashing out at me here? Have I insulted you in this thread? Or are you just insecure?
like I said you need hook3d on phonics
when he replied to that guys code he said
it didnt work and he posted what he tried
giving out his code
which was a string called bankaccount
learn how to read

Knightoffrost
08-19-2001, 10:50 PM
Here we go again. Kaimetsu dont critize (sp?) Liquids effort to help someone with a script when you never help anyone as far as I can tell. You mearly critize their script rather then writing one for them. You'd say to bad this and to bad that and only if this and if only that but do you ever really help people on the forums?

Falcor
08-20-2001, 12:52 AM
Excuse me but, Liquid Ice, You are showing your childish nature to us right now buy insulting grammer when you already have grammer mistakes in your post. I suggest you stop being a hypocrite and stop being so childish. I think its becuase you cannot deal wth the fact that there are people better then you so you take all your anger out on them. Well that does not help. In fact it makes matters worse. Not get out of your booster chair and act like you have reached puberty.

LiquidIce00
08-20-2001, 01:00 AM
falcor u got the whole thing around

CrazedMerlin
08-20-2001, 01:32 AM
hey "ur dumb."

Xaviar
08-20-2001, 01:35 AM
Wonderfull...This time a thread called "scripting help" falls to an argument...Dont you folks have anything to do besides argue? Hey..Im not saying you have no life...Im just saying...There are better places to argue than in the thread of someone looking for help..Please use at least a little discretion?

LiquidIce00
08-20-2001, 01:50 AM
Originally posted by Xaviar
Wonderfull...This time a thread called "scripting help" falls to an argument...Dont you folks have anything to do besides argue? Hey..Im not saying you have no life...Im just saying...There are better places to argue than in the thread of someone looking for help..Please use at least a little discretion?

I helped the guy. and apperently the only one

Cybnext_Design
08-20-2001, 08:08 AM
Actually Kaimetsu, i want the original bankaccount to go back into string form.

So LiquidIce is right.

And i hope one of those scripts work.

And bankaccount needs to be strings.
But i dont really care if the baccount0-6 are just variables.

Cybnext_Design
08-20-2001, 08:33 AM
Originally posted by Kaimetsu


May I ask what it's for? If it's to show numbers as portions of an image, then use variables.

Just a way to display how much money you have in your bank account. And im going to use an array for it.

LiquidIce00
08-20-2001, 11:06 AM
http://forums.graal2001.com/forums/showthread.php?threadid=6657&highlight=shownumber

thats some thread i posted a function that uses the states.png to put numbers on the screen ..
it also goes thru it number by number like u can say
this.number=strtofloat(#s(bankaccount));
and it would display all ur money on the screen .. and crap like that

Knightoffrost
08-21-2001, 01:59 PM
<[ Delph Inc. ]>
Thanks for posting that script...I wouldn't have known what to do because I'm hopeless with '%', I wouldn't have a clue what to do with it. Same with a few other little symbols...Like...I know it get the remainder of a/b but I just don't know where it could fit in because it's hard to understand how it would get a number you actually want every time...just like the bank script from Liquid.
The only way around I had was this:

this.rupeecount1=int(playerrupees/1000000);
this.rupeecount2=int((playerrupees-this.rupeecount1*1000000)/100000);
this.rupeecount3=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000))/10000);
this.rupeecount4=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000))/1000);
this.rupeecount5=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000))/100);
this.rupeecount6=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000)-(this.rupeecount5*100))/10);
this.rupeecount7=int((playerrupees-(this.rupeecount1*1000000)-(this.rupeecount2*100000)-(this.rupeecount3*10000)-(this.rupeecount4*1000)-(this.rupeecount5*100)-(this.rupeecount6*10)));


It works fine but only allows '9999899' and it's too long for my liking...the other way should probably make this system script a bit shorter.
Well...this isn't the system script...The system script is quite a bit larger...this is only the rupee part...I had a screenshot but when I uploaded it...it practically chewed half the image up...honestly...you would be impressed for it coming from an only average scripter.
I'll try get the screen now.

</[ Delph Inc. ]>[

LiquidIce00
08-22-2001, 02:41 AM
hehe np =P

I like to make tons of functions and i just call em for system npc's and its easy to edit/add crap in it

General
08-22-2001, 03:06 AM
Originally posted by Cybnext_Design
I am trying to make a script where it takes your ATM Account and puts every number in a different tempstring like this:

say the ATM Account has 1 million dollars in it.

baccount1=1
baccount2=0
baccount3=0
baccount4=0
baccount5=0
baccount6=0
baccount7=0

And let me remind you that this ATM Account will change in amount.

And i know how to to do this with a 3 digit number but everything i try never works on a 7 digit number.

Can anyone help?

I just LOVE how he is NAT Chief in dino valley

LiquidIce00
08-22-2001, 03:07 AM
Originally posted by General


I just LOVE how he is NAT Chief in dino valley

mind ur own business =\
if ur not gonna post nething smart then dont post