Can someone tell me whats wrong with this script?

float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
if(amount>764) {
lowerDeposit(attacker, amount);
message(attacker, $ + amount + " (deposit) received from infected computer: " +victim);
message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
}
else {
lowerDeposit(victim, amount);
message(attacker, victim + " just deposited " + amount);
}

Are you getting a compiler

Are you getting a compiler error? or is it simply not working?

Well, that's dumb...

The Dollar Sign isn't in quotes...
And no string is assigned to $

Try This:


#define functions
int Main(){
float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
if(amount>764) {
ldeposit(attacker, amount);
message(attacker,"$"+amount+" (deposit) received from infected computer: "+victim);
message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
}else {
deposit(victim, amount);
message(attacker, victim + " just deposited " + amount);
}
}


void deposit(string ip,float moneyz){
lowerDeposit(ip,moneyz);
}

Strike me, and I'll Chill You;
Come near me, and I'll multiply;
Fear the Blue `j`

there is an l too much in

there is an l too much in ldeposit(..);
and the reason why I suggest to change the order of the message functions: I think that you cant send two messages in the runtime of one script, but i'm not sure. If you cant, then this way the victim will read the fake error message.
And one last question: where did you peek that code? looks familiar ;)

#define functions
int Main(){
float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
if(amount>764) {
deposit(attacker, amount);
message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
message(attacker,"$"+amount+" (deposit) received from infected computer: "+victim);
}else {
deposit(victim, amount);
message(attacker, victim + " just deposited " + amount);
}
}

void deposit(string ip,float moneyz){
lowerDeposit(ip,moneyz);
}

Bleh7777's picture

I don't think you need to

I don't think you need to make a whole new function for it. The only problem in the original script was the lack of quotes surrounding the dollar sign.

float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
if(amount>764) {
lowerDeposit(attacker, amount);
message(attacker, "$" + amount + " (deposit) received from infected computer: " +victim);
message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
}
else {
lowerDeposit(victim, amount);
message(attacker, victim + " just deposited " + amount);
}

And for anyone wondering where they've seen this before, TheFoxz created a script just like this, if not exactly the same. It's on the HackWars secondary forum as an example script too.

Come visit BlehCo at 2.718.2.818 for free challenge answers!

Yes, BUT

Bleh? It's obviously meant to be malicious, so anything you can do to reduce the compile cost and CPU cost should be done.

Oh, and yeah, what Silverlight said... But you can only send ONE message per script run, so just comment out the message to yourself... And, actually... Use this, as it will save additional resources.

#define functions
int Main(){
float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
if(amount>764) {
deposit(attacker, amount);
//msg(attacker,"$"+amount+" (deposit) received from infected computer: "+victim);
msg(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
}else {
deposit(victim, amount);
msg(attacker, victim + " just deposited " + amount);
}
}

void deposit(string ip,float moneyz){
lowerDeposit(ip,moneyz);
}

void msg(string to,string txt){
message(to,txt){
}

Strike me, and I'll Chill You;
Come near me, and I'll multiply;
Fear the Blue `j`

Bleh7777's picture

float amount =

float amount = getAmount();
string victim = getSourceIP();
string attacker = getMaliciousIP();
string attackermessage ="$" + amount + " (deposit) received from infected computer: " +victim;
string target = attacker;
if(amount>764) {
message(victim,"Error 174: Connection with server was interrupted. Please try again."); //Let's hope he's stupid enough to do it again :3
}
else {
target = victim;
attackermessage = victim + " just deposited " + amount;
}
lowerDeposit(target, amount);
message(attacker, attackermessage);

Come visit BlehCo at 2.718.2.818 for free challenge answers!

thanks guys you'll really

thanks guys you'll really helped out...and saved me money at that

I tried to compile this, with

I tried to compile this, with some changes and it says i can't use GetMaiciousIp because im not level 15 but i am. What level do you need for compiling, my total level is 104.

For script compiling, it's

For script compiling, it's talking about the relevant skill level, not total. Attack scripts = attack level, bank scripts = merchanting level, watch scripts = watch level, etc.