A=? B=? C=?
Moderators: Moderators, Documentation Writers
A=? B=? C=?
I have a Question about the BotKiller.
The BotKiller want to solve a math problem with "How Many is A+B-C" and such things.
But the Solution I found is not working because the BotKiller use more than one variant of Check, its like:
A+B
A-B
A+B-C
A-B+C
and so on. Now my Question do I need more than one block for react on NPC or how does it work?
The BotKiller want to solve a math problem with "How Many is A+B-C" and such things.
But the Solution I found is not working because the BotKiller use more than one variant of Check, its like:
A+B
A-B
A+B-C
A-B+C
and so on. Now my Question do I need more than one block for react on NPC or how does it work?
Re: A=? B=? C=?
Use automacro with console hook that's all.
Something like that:
Will trigger 2+2, 2-2, 2+2+2, 2-2-2, 2-2+2, 2+2-2
Will not trigger 2+, 2+2+, 2-, 2-2-, 2-2+, 2+2-
Just need to change that for yours corresponding full line:
and this code will work fine i think:
Something like that:
Code: Select all
automacro countItForMe {
console /(\d+)(-|\+)(\d+)(-|\+(?:\d+))/i
call doCount
}
macro doCount {
pause 1
$doThis = $.lastMatch1$.lastMatch2$.lastMatch3$.lastMatch4$.lastMatch5
$res = @eval($doThis)
do talk num $res
}
Will not trigger 2+, 2+2+, 2-, 2-2-, 2-2+, 2+2-
Just need to change that for yours corresponding full line:
Code: Select all
/(\d+)(-|\+)(\d+)(-|\+(?:\d+))/i
- Attachments
-
- 12431241qaaaaaa.png (5.46 KiB) Viewed 5751 times
Last edited by Mortimal on 09 Mar 2017, 12:25, edited 2 times in total.
Please use pin function for uploading your file contents!
Re: A=? B=? C=?
could you explain this line a little bit more?
Code: Select all
/(\d+)(-|\+)(\d+)(-|\+(?:\d))/i
Re: A=? B=? C=?
Code: Select all
/(\d+)(-|\+)(\d+)(-|\+(?:\d+))/i
( ) --> delimiter - whats inside will be remembered as $.lastMatchN
\d+ --> \d - digit; + means any number of previous statement -> \d <- but not none
-|\+ --> - or +; \ here is mirror for + because + is special
?: --> used to connect \d+ statement to previous -|\+ statement (wont work without this i remember we need this but cant remember why we need this x) )
Use this for details:
http://perldoc.perl.org/perlrequick.html
http://perldoc.perl.org/perlretut.html
Please use pin function for uploading your file contents!
Re: A=? B=? C=?
The seconde problem is that the Numbers are not everytime in the right position like in the picture:
- Attachments
-
- billltt.png (4.51 KiB) Viewed 5735 times
Re: A=? B=? C=?
Aw i get it:
I think this will work...
..........or letters in second line also change places?
Code: Select all
automacro countItForMe {
console /Unknown\s#\d+:\s>If\s?:\s([ABC])=(\d+)\s([ABC])=(\d+)\s([ABC])=(\d+).*\nUnknown\s#\d+: How many is A\s(-|\+)\sB\s(-|\+)\sC.*/i
call doCount
}
macro doCount {
pause 1
switch ($.lastMatch1) {
case (== A){$a = $.lastMatch2}
case (== B){$b = $.lastMatch2}
case (== C){$c = $.lastMatch2}
}
switch ($.lastMatch3) {
case (== A){$a = $.lastMatch4}
case (== B){$b = $.lastMatch4}
case (== C){$c = $.lastMatch4}
}
switch ($.lastMatch5) {
case (== A){$a = $.lastMatch6}
case (== B){$b = $.lastMatch6}
case (== C){$c = $.lastMatch6}
}
$doThis = $a$.lastMatch7$b$.lastMatch8$c
$res = @eval($doThis)
do talk num $res
}
..........or letters in second line also change places?
Please use pin function for uploading your file contents!
Re: A=? B=? C=?
no only in first line but they can be 2 or 3 I will try thank you!
but it doesnt work, it doesnt trigger and have a error on switch
but it doesnt work, it doesnt trigger and have a error on switch
Re: A=? B=? C=?
use second AM
Code: Select all
automacro countItForMe2 {
console /Unknown\s#\d+:\s>If\s?:\s([AB])=(\d+)\s([AB])=(\d+).*\nUnknown\s#\d+: How many is A\s(-|\+)\sB.*/i
call doCount2
}
macro doCount2 {
pause 1
switch ($.lastMatch1) {
case (== A){$a = $.lastMatch2}
case (== B){$b = $.lastMatch2}
}
switch ($.lastMatch3) {
case (== A){$a = $.lastMatch4}
case (== B){$b = $.lastMatch4}
}
$doThis = $a$.lastMatch5$b$
$res = @eval($doThis)
do talk num $res
}
Please use pin function for uploading your file contents!
Re: A=? B=? C=?
What error? Better give me log console...
Please use pin function for uploading your file contents!